For example, there are 18 tickets to be distributed among four classes, A, B, C, and D, with the requirement that Class A gets at least 1 ticket but no more than 5 tickets, Class B gets at least 1 ticket but no more than 6 tickets, Class C gets at least 2 tickets but no more than 7 tickets, and Class D gets at least 4 tickets but no more than 10 tickets. How many different ways of distribution are there?
Solve for the generating function of the number of ways to distribute the visit tickets according to the various possibilities for each class:
$$
f(t)=\left(t+t^{2}+t^{3}+t^{4}+t^{5}\right)\left(t+t^{2}+\cdots+t^{6}\right)\left(t^{2}+t^{3}+\cdots+t^{7}\right)\left(t^{4}+t^{5}+\cdots+t^{10}\right)
$$

Find the coefficient of $t^{18}$, $a_{18}=140$. This is the number of distribution methods sought.