If three third grade classes collect apples and the first class collects three times as much as the third class, and the second class collects twice as much as the third class. If the class collects a total of 360 apples, how many apples did each class collect?