The teachers at Funtime School like to include games in their lessons.
At the end of one day, one teacher invites his students to play a game. The winner gets to leave school before the others are dismissed.
Rules of the game:
The school has one corridor with five doors in a row. The students form a queue and take turns to walk down the corridor. When they get to an open door, they must close it and move to the next door, When they get to a closed door, they must open it, go into the calsswroom, leave the door open and wait there until the teacher dismisses them.
At the start of the game all the doors are closed.
If a student finds all the doors are open, after shutting each of them, they can head home for their tea!
Question:
If the students are numbered 1 to 35, which student gets to leave school first?