fn getline() -> String {
    let mut res = String::new();
    std::io::stdin().read_line(&mut res).ok();
    res
}

#[allow(unused_macros)]
macro_rules! readl {
    ($t: ty) => {
        {
            let s = getline();
            s.trim().parse::<$t>().unwrap()
        }
    };
    ($( $t: ty),+ ) => {
        {
            let s = getline();
            let mut iter = s.trim().split(' ');
            ($(iter.next().unwrap().parse::<$t>().unwrap(),)*)
        }
    };
}

#[allow(unused_macros)]
macro_rules! readlvec {
    ($t: ty) => {
        {
            let s = getline();
            let iter = s.trim().split(' ');
            iter.map(|x| x.parse().unwrap()).collect::<Vec<$t>>()
        }
    }
}

#[allow(unused_macros)]
macro_rules! debug {
    ($x: expr) => {
        println!("{}: {:?}", stringify!($x), $x)
    }
}

fn printiter<'a, T>(v: &'a T)
where
    &'a T: std::iter::IntoIterator,
    <&'a T as std::iter::IntoIterator>::Item: std::fmt::Display,
{
    for (i, e) in v.into_iter().enumerate() {
        if i != 0 {
            print!(" ");
        }
        print!("{}", e);
    }
    println!("");
}

#[allow(unused_imports)]
use std::cmp::{max, min};
#[allow(unused_imports)]
use std::collections::{BTreeMap, BinaryHeap, HashMap, HashSet};
#[allow(unused_imports)]
use std::collections::btree_map::Entry::{Occupied, Vacant};

fn experiment(a: usize, k: usize) -> usize {
    let mut dp = vec![0; a+1];
    for i in k..a+1 {
        let mut f = vec![false; a+1];
        for j in 1..i/k+1 {
            f[dp[i-j]] = true;
        }
        for (j, &e) in f.iter().enumerate() {
            if !e {
                dp[i] = j;
                break;
            }
        }
    }
    // debug!(dp);
    // for (i, &e) in dp.iter().enumerate() {
    //     if i%k == 0 {
    //         println!("");
    //     }
    //     print!("{: >5} ", e);
    // }
    dp.pop().unwrap()
}

// fn calc0(a: usize, k: usize) -> usize {

// }

// fn calc1(a: usize, k: usize) -> usize {

// }

fn get_grundy(a: usize, k: usize) -> usize {
    // debug!(a);
    if a < k {
        0
    } else if a%k == 0 {
        a/k
    } else if a >= k * k {
        get_grundy(a - (a / k + 1), k)
    } else {
        let d = a % k % (a / k + 1);
        // debug!(d);
        let a = (a / k)*k + d;
        if a%k == 0 {
            a/k
        } else {
            get_grundy(a - (a / k + 1), k)
        }
    }
}

// fn get_grundy(a: usize, k: usize) -> usize {
//     // debug!(a);
//     if a < k {
//         0
//     } else if a%k == 0 {
//         a/k
//     } else if a >= k * k {
//         get_grundy(a - (a / k + 1), k)
//     } else {
//         get_grundy_(a, k)
//     }
// }

// fn get_grundy_(a: usize, k: usize) -> usize {
//     // debug!(a);
//     if a < k {
//         0
//     } else if a % k == 0 {
//         a / k
//     } else {
//         let d = a % k % (a / k + 1);
//         // debug!(d);
//         let a = (a / k)*k + d;
//         if a%k == 0 {
//             a/k
//         } else {
//             get_grundy_(a - (a / k + 1), k)
//         }
//     }
// }

fn main() {
    use std::io::Write;
    let out = std::io::stdout();
    let mut out = std::io::BufWriter::new(out.lock());
    macro_rules! printf { ($($arg:tt)*) => (write!(out, $($arg)*).unwrap()); }
    macro_rules! printfln { () => (writeln!(out).unwrap()); ($($arg:tt)*) => (writeln!(out, $($arg)*).unwrap()); }

    // for i in 1..21 {
    //     experiment(1000, i);
    // }

    let mut xor = 0;
    let n = readl!(usize);
    for _ in 0..n {
        let (a, k) = readl!(usize, usize);
        if k == 1 {
            xor ^= a;
        } else {
            // debug!(get_grundy(a, k));
            // debug!(experiment(a, k));
            xor ^= get_grundy(a, k);
        }
    }
    if xor == 0 {
        printfln!("Aoki");
    } else {
        printfln!("Takahashi");
    }
}


Measured memory_bytes: 4352