Control the teachers by opening/closing the doors. Send the students through the exit door without being caught by the teachers. If you get caught by the teachers, you will end up in the punishment room. So don't get caught by the teacher or sacrifice some of your friends.