program strange_nim
  implicit none
  integer :: n, a, k, d, m, i, g = 0
  read(*,*) n
  do i = 1, n
    read(*,*) a, k
    do
      d = a/k
      m = mod(a,k)
      if (m == 0) exit
      a = a-(m+d)/(d+1)*(d+1)
    end do
    g = xor(g,d)
  end do
  if (g == 0) then
    write(*,'(a)') "Aoki"
  else
    write(*,'(a)') "Takahashi"
  end if
end program strange_nim