atcoder#ARC151C. [ARC151C] 01 Game

[ARC151C] 01 Game

Score : 600600 points

Problem Statement

There are NN squares called square 11, square 22, \ldots, square NN, where square ii and square i+1i+1 are adjacent for each i=1,2,,N1i = 1, 2, \ldots, N-1.

Initially, MM of the squares have 00 or 11 written on them. Specifically, for each i=1,2,,Mi = 1, 2, \ldots, M, YiY_i is written on square XiX_i. The other NMN-M squares have nothing written on them.

Takahashi and Aoki will play a game against each other. The two will alternately act as follows, with Takahashi going first.

  • Choose a square with nothing written yet, and write 00 or 11 on that square. Here, it is forbidden to make two adjacent squares have the same digit written on them.

The first player to be unable to act loses; the other player wins.

Determine the winner when both players adopt the optimal strategy for their own victory.

Constraints

  • 1N10181 \leq N \leq 10^{18}
  • 0Mmin{N,2×105}0 \leq M \leq \min\lbrace N, 2 \times 10^5 \rbrace
  • 1X1<X2<<XMN1 \leq X_1 \lt X_2 \lt \cdots \lt X_M \leq N
  • Yi{0,1}Y_i \in \lbrace 0, 1\rbrace
  • Xi+1=Xi+1    YiYi+1X_i + 1 = X_{i+1} \implies Y_i \neq Y_{i+1}
  • All values in the input are integers.

Input

The input is given from Standard Input in the following format:

NN MM

X1X_1 Y1Y_1

X2X_2 Y2Y_2

\vdots

XMX_M YMY_M

Output

If Takahashi wins, print Takahashi; if Aoki wins, print Aoki.

7 2
2 0
4 1
Takahashi

Here is one possible progression of the game.

  1. Takahashi writes 00 on square 66.
  2. Aoki writes 11 on square 11.
  3. Takahashi writes 11 on square 77.

Then, Aoki cannot write 00 or 11 on any square, so Takahashi wins.

3 3
1 1
2 0
3 1
Aoki

Since every square already has 00 or 11 written at the beginning, Takahashi, who goes first, cannot act, so Aoki wins.

1000000000000000000 0
Aoki