Use the arrow keys or touchscreen to move the pencil, so you can prevent the apple from reaching the deskspace, or the red line.
Apples don't really have to do with school.