// Slower C++ solution:
#include <iostream>

#include <sstream>

#include <cstdio>

#include <cstdlib>

#include <cmath>

#include <ctime>

#include <cstring>

#include <string>

#include <vector>

#include <stack>

#include <queue>

#include <deque>

#include <map>

#include <set>

#include <bitset>

#include <numeric>

#include <utility>

#include <iomanip>

#include <algorithm>

#include <functional>

#include <unordered_map>

using namespace std;



#define REP(i, s) for (int i = 0; i < s; ++i)

#define ALL(v) (v.begin(), v.end())

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)



template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)

{ return s << '<' << P.first << ", " << P.second << '>'; }

template<class T> ostream& operator << (ostream &s, vector<T> P)

{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }

template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)

{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }

template<class T> ostream& operator << (ostream &s, set<T> P)

{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }

template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)

{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }







long long N;

int A[210], K[210];



string sente = "Takahashi";

string gote = "Aoki";



int g[1000];

int rec(int v, int k) {

    if (g[v] != -1) return g[v];

    if (v == 0) return 0;

    set<int> se;

    for (int i = 1; i <= v/k; ++i) {

        int val = rec(v - i, k);

        se.insert(val);

    }

    int res = 0;

    while (se.count(res)) ++res;

    return g[v] = res;

}



void testGrundy(int k) {

    memset(g, -1, sizeof(g));

    g[0] = 0;

    for (int i = 1; i <= 900; ++i) {

        cout << i << ": " << rec(i, k) << endl;

    }

}





int memo[210000];

int subGrundy(int a, int k) {

    if (a < k) return memo[a] = 0;

    if (a < 210000 && memo[a] != -1) return memo[a];

    if (a % k == 0) return a/k;

    

    int p = a/k;

    int res = subGrundy(a - p - 1, k);



    if (a < 210000) return memo[a] = res;

    else return res;

}







int Grundy(int a, int k) {

    if (a < k) return 0;

    if (a % k == 0) return a/k;

    

    memset(memo, -1, sizeof(memo));

    return subGrundy(a, k);

}





string solve() {

    int res = 0;

    for (int i = 0; i < N; ++i) {

        int tmp = Grundy(A[i], K[i]);

        res ^= tmp;

    }

    if (res) return sente;

    else return gote;

}



int main() {

    

    //testGrundy(12);

    

    

    while (cin >> N) {

        for (int i = 0; i < N; ++i) cin >> A[i] >> K[i];

        cout << solve() << endl;

    }

}










// Faster C++ solution for the same problem (measured speedup: 1.8840583083734515x):
#include <iostream>

#include <sstream>

#include <cstdio>

#include <cstdlib>

#include <cmath>

#include <ctime>

#include <cstring>

#include <string>

#include <vector>

#include <stack>

#include <queue>

#include <deque>

#include <map>

#include <set>

#include <bitset>

#include <numeric>

#include <utility>

#include <iomanip>

#include <algorithm>

#include <functional>

#include <unordered_map>

using namespace std;



template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }

template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }



template<class T> vector<T> make_vec(size_t a) { return vector<T>(a); }

template<class T, class... Ts> auto make_vec(size_t a, Ts... ts) {

  return vector<decltype(make_vec<T>(ts...))>(a, make_vec<T>(ts...));

}

template<class T, class V>

typename enable_if<is_class<T>::value == 0>::type fill(T &t, const V &v) {

    t = v;

}

template<class T, class V>

typename enable_if<is_class<T>::value != 0>::type fill(T &t, const V &v){

    for (auto &e : t) fill(e, v);

}



#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl

template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)

{ return s << '<' << P.first << ", " << P.second << '>'; }

template<class T> ostream& operator << (ostream &s, vector<T> P)

{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }

template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)

{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }



#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)

template<class T> ostream& operator << (ostream &s, set<T> P)

{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }

template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)

{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }







int g[10010];

int rec(int v, int k) {

    if (g[v] != -1) return g[v];

    if (v == 0) return 0;

    set<int> se;

    for (int i = 1; i <= v/k; ++i) {

        int val = rec(v - i, k);

        se.insert(val);

    }

    int res = 0;

    while (se.count(res)) ++res;

    return g[v] = res;

}

 





long long Grundy(long long a, long long k) {

    if (a < k) return 0;

    if (a % k == 0) return a/k;



    long long diff = a/k + 1;

    long long ta = a - diff;

    if (ta / k < a / k) return Grundy(ta, k);

    

    long long low = 0, high = a;

    while (high - low > 1) {

        long long mid = (low + high) / 2;

        long long na = a - mid * diff;

        bool ok = true;

        if (na / k == a / k) ok = true;

        else ok = false;

        if (ok) low = mid;

        else high = mid;

    }



    return Grundy(a - max(low, 1LL)*diff, k);

}





void test(int k) {

    memset(g, -1, sizeof(g));

    g[0] = 0;

    for (int i = 1; i <= 1000; ++i) {

        //cout << i << ": " << rec(i, k) <<  ", " << Grundy(i, k) << endl;

    }

}





int main() {

    test(100);

    int N;

    while (cin >> N) {

        long long res = 0;

        for (int i = 0; i < N; ++i) {

            long long a, k;

            cin >> a >> k;

            res ^= Grundy(a, k);

        }

        if (res) cout << "Takahashi" << endl;

        else cout << "Aoki" << endl;

    }

}