If we have three distinct items, we should choose three classes by $\binom{3}{3}$ so we have $1$ possibility here.
If we have two distinct items, we should choose two classes by $\binom{3}{2}$ and we can also interchange the items by $2$ ways (like two from $A$, one from $B$ and two from $B$, one from $A$) so we have $2\binom{3}{2} = 6$ possibilities here.
If we have only one type of item, we should choose either the first class or second class (since class $C$ doesn not have three items in it) so we have $2$ possiblities here.
In total, we have $1+6+2 = 9$ possibilities.