There is an ambiguity in the question. It’s not clear whether a student from class B can be first or second as well as third, so both cases will be given.
There are 8 possible outcomes, 4 with a class B student only in third place and 4 with the other class B student placed first or second as well as third.
AAB (3/10)(2/9)(2/8)=1/60
ACB (3/10)(5/9)(2/8)=1/24
CAB (5/10)(3/9)(2/8)=1/24
CCB (5/10)(4/9)(2/8)=1/18
ABB (3/10)(2/9)(1/8)=1/120
BAB (2/10)(3/9)(1/8)=1/120
BCB (2/10)(5/9)(1/8)=1/72
CBB (5/10)(2/9)(1/8)=1/72
If we take the sum of the first 4 probabilities we get 7/45.
The sum of the last 4 probabilities is 2/45.
The total is 9/45=1/5.
If we want the probability of the third student being from class B without the other student from the same class already being picked then the probability is 7/45 (15.56%).
Otherwise the probability is 1/5 (20%), meaning that the other student from class B may or may not have already been picked.