Rock paper scissors

No attempts yetTime limit1sMemory limit256 MB

Problem

Rock paper scissors is a game in which two players each throw scissors, rock, or paper at the same time. Scissors beat paper, rock beats scissors, and paper beats rock. Matching throws are a tie.

Scissors is 00, rock is 11, and paper is 22.

You already played NN rounds against the opponent. Choose the next throw by this rule.

  • If N=0N = 0, throw 00.
  • If N1N \ge 1, let bb be the opponent's throw in the last round. Throw 22 when b=1b = 1, and throw 00 otherwise.

Earlier wins, losses, and your own past throws do not change the next throw.

Input

The first line contains NN. (0N100000 \le N \le 10000)

Each of the next NN lines contains two integers, your throw and the opponent's throw, separated by a space. Each value is 00, 11, or 22.

If N=0N = 0, there are no further lines.

Output

Print the next throw on one line. Scissors is 00, rock is 11, and paper is 22.

Hint

N=0N = 0 is the start of the match, so there is no prior result. Print 00 in that case. Otherwise only the opponent's last throw matters.