There are 24 students in a seventh grade class. They decided to plant birches and roses at the school's backyard. While each girl planted 3 roses, every 3 boys planted 1 birch. By the end of the day, they planted 24 plants. How many birches and roses were planted?