The head of the class is the top place, and the foot of it is the bottom. The joke needs both meanings of foot: last in the row, and the end of a leg.
What is the difference between a bright pupil and shoe polish?
Give me a hintThe hint
Think about where each one ends up.