# How to distribute $n$ balls of different kinds among $n$ baskets of different kinds? Non-trivial combinatorics/permutation task

I have a task that I don't know how to approach. There are $n$ baskets of four types; $n$>1000. Each basket fits exactly one ball. Number of balls equals number of baskets. Balls are of different kinds as well. Basket of kind $1$ may accommodate only balls of kinds $1$ or $2$. Basket of kind $2$ fits balls of kind $3$ or $4$. Baskets of kind $3$ fits all kinds of balls ($1$, $2$, $3$, or $4$). And basket of kind $4$ fits balls of kinds $1$, $2$, or $3$. In how many ways can these balls be distributed?

• How many kind of baskets of each type, and how many kind of balls of each type there are? – Masacroso Apr 20 '16 at 9:23
• Proportions for a kind in respect to total balls/baskets vary from 0.15 to 0.6 – user333084 Apr 20 '16 at 10:18