{-# LANGUAGE ScopedTypeVariables #-}

import Data.Bits
import Control.Monad


rgl :: (Read a) => IO a
rgl = (liftM read) getLine

f :: Int -> Int -> Int
f x k = if x < k 
                then 0
                else if x `mod` k == 0
                        then v
                        else f (x - v - 1) k
                        where v = x `div` k

main = do
        n :: Int <- rgl
        xs :: [(Int, Int)] <- replicateM n $ do
                                        [a, b] <- (liftM words) getLine
                                        return (read a, read b)
        let     vals = map (uncurry f) xs
                ans  = foldl xor 0 vals

        if ans == 0
                then putStrLn "Aoki"
                else putStrLn "Takahashi"
