Jan has a special vehicle that looks like a Segway. He moves it by pressing two buttons: a blue (light) button on the left, and a red (dark) button on the right.

When he presses a button, the wheel on that side of the vehicle rotates:
If both buttons are pushed at the same time, both wheels rotate and the vehicle moves forward.
If he pushes a single button, only one wheel rotates and the vehicle turns.


The follow tables shows which button was pushed when, and how the vehicle moved from location 1 to location 2.

  2016-CZ-06-example1              2016-CZ-06-example2

First, the blue button was pressed and the vehicle turned to the right. Then both buttons were pressed, and the vehicle moved forward. Finally the red button was pressed, and the vehicle turned left. The orientation of the vehicle is now the same as in the beginning: facing towards the upper wall.

Here is a record of the button presses from a different journey:

The vehicle kept going until it hit one of the walls. At the start the vehicle was facing towards the upper wall.

Towards which wall was the vehicle facing in the end?