program strange_nim
  implicit none
  integer :: n, a, k, i, g = 0
  read(*,*) n
  do i = 1, n
    read(*,*) a, k
    g = xor(g,grundy(a,k))
  end do
  if (g == 0) then
    write(*,'(a)') "Aoki"
  else
    write(*,'(a)') "Takahashi"
  end if
contains
  recursive function grundy(a,k) result(ret)
    integer, intent(in) :: a, k
    integer :: ret
    ret = a/k
    if (ret == 0 .or. mod(a,k) == 0) return
    ret = grundy(a-ret-1,k)
  end
end program strange_nim