output_description: If Takahashi will win, print `Takahashi`; if Aoki will win, print `Aoki`.
  
  * * *
input_description: Input is given from Standard Input in the following format:
  
      
      
      N
      A_1 K_1
      :
      A_N K_N
attempt: from math import ceil
  
  
  def grundy(a, k):
      if a < k:
          return 0
      d, m = divmod(a, k)
      if m == 0:
          return d
      d1 = d + 1
      if d > k:
          return grundy(a - d1, k)
      e = ceil(m / d1) * d1
      return grundy(a - e, k)
  
  
  n = int(input())
  nim = 0
  for _ in range(n):
      a, k = map(int, input().split())
      nim ^= grundy(a, k)
  print("Takahashi" if nim > 0 else "Aoki")
  
problem_description: Statement
  
  Takahashi and Aoki are playing a stone-taking game. Initially, there are N
  piles of stones, and the i-th pile contains A_i stones and has an associated
  integer K_i.
  
  Starting from Takahashi, Takahashi and Aoki take alternate turns to perform
  the following operation:
  
    * Choose a pile. If the i-th pile is selected and there are X stones left in the pile, remove some number of stones between 1 and floor(X/K_i) (inclusive) from the pile.
  
  The player who first becomes unable to perform the operation loses the game.
  Assuming that both players play optimally, determine the winner of the game.
  Here, floor(x) represents the largest integer not greater than x.
samples: [{"input": "2\n    5 2\n    3 3", "output": "Aoki\n    \n\nInitially, from the first pile at most floor(5/2)=2 stones can be removed at a\ntime, and from the second pile at most floor(3/3)=1 stone can be removed at a\ntime.\n\n  * If Takahashi first takes two stones from the first pile, from the first pile at most floor(3/2)=1 stone can now be removed at a time, and from the second pile at most floor(3/3)=1 stone can be removed at a time.\n  * Then, if Aoki takes one stone from the second pile, from the first pile at most floor(3/2)=1 stone can be removed at a time, and from the second pile no more stones can be removed (since floor(2/3)=0).\n  * Then, if Takahashi takes one stone from the first pile, from the first pile at most floor(2/2)=1 stone can now be removed at a time, and from the second pile no more stones can be removed.\n  * Then, if Aoki takes one stone from the first pile, from the first pile at most floor(1/2)=0 stones can now be removed at a time, and from the second pile no more stones can be removed.\n\nNo more operation can be performed, thus Aoki wins. If Takahashi plays\ndifferently, Aoki can also win by play accordingly.\n\n* * *"}, {"input": "3\n    3 2\n    4 3\n    5 1", "output": "Takahashi\n    \n\n* * *"}, {"input": "3\n    28 3\n    16 4\n    19 2", "output": "Aoki\n    \n\n* * *"}, {"input": "4\n    3141 59\n    26535 897\n    93 23\n    8462 64", "output": "Takahashi"}]