#include<bits/stdc++.h>
using namespace std;
int n;
int main()
{
    scanf("%d",&n);
    int ans=0;
    for(int i=1;i<=n;i++)
    {
        int x,k;scanf("%d%d",&x,&k);
        while(x%k)
        {
            int t=x/k+1;
            x=x/k*k+(x-x/k*k)%t;
            if(x%k)
                x-=t;
        }
        ans^=x/k;
    }
    if(ans) puts("Takahashi");
    else puts("Aoki");
}
/*
10
1 0 1 0 1 0 1 0 1 0
2 1 0 2 1 0 2 1 0 2
3 1 0 2 3 1 0 2 3 1
4 0 2 3 1 4 0 2 3 1
5 4 0 2 3 1 5 4 0 2
6 3 1 5 4 0 2 6 3 1
*/
/*
#include<bits/stdc++.h>
using namespace std;
const int N=105;
int k,sg[N];
int main()
{
    scanf("%d",&k);
    for(int i=k;i<2*k;i++)
        sg[i]=sg[i-1]^1;
    for(int i=2*k;i<3*k;i++)
    {
        if(sg[i]==sg[i-1]||sg[i]==sg[i-2]) sg[i]++;
        if(sg[i]==sg[i-1]||sg[i]==sg[i-2]) sg[i]++;
    }
    for(int i=3*k;i<4*k;i++)
    {
        if(sg[i]==sg[i-1]||sg[i]==sg[i-2]||sg[i]==sg[i-3]) sg[i]++;
        if(sg[i]==sg[i-1]||sg[i]==sg[i-2]||sg[i]==sg[i-3]) sg[i]++;
        if(sg[i]==sg[i-1]||sg[i]==sg[i-2]||sg[i]==sg[i-3]) sg[i]++;
    }
    for(int i=4*k;i<5*k;i++)
    {
        if(sg[i]==sg[i-1]||sg[i]==sg[i-2]||sg[i]==sg[i-3]||sg[i]==sg[i-4]) sg[i]++;
        if(sg[i]==sg[i-1]||sg[i]==sg[i-2]||sg[i]==sg[i-3]||sg[i]==sg[i-4]) sg[i]++;
        if(sg[i]==sg[i-1]||sg[i]==sg[i-2]||sg[i]==sg[i-3]||sg[i]==sg[i-4]) sg[i]++;
        if(sg[i]==sg[i-1]||sg[i]==sg[i-2]||sg[i]==sg[i-3]||sg[i]==sg[i-4]) sg[i]++;
    }
    for(int i=5*k;i<6*k;i++)
    {
        if(sg[i]==sg[i-1]||sg[i]==sg[i-2]||sg[i]==sg[i-3]||sg[i]==sg[i-4]||sg[i]==sg[i-5]) sg[i]++;
        if(sg[i]==sg[i-1]||sg[i]==sg[i-2]||sg[i]==sg[i-3]||sg[i]==sg[i-4]||sg[i]==sg[i-5]) sg[i]++;
        if(sg[i]==sg[i-1]||sg[i]==sg[i-2]||sg[i]==sg[i-3]||sg[i]==sg[i-4]||sg[i]==sg[i-5]) sg[i]++;
        if(sg[i]==sg[i-1]||sg[i]==sg[i-2]||sg[i]==sg[i-3]||sg[i]==sg[i-4]||sg[i]==sg[i-5]) sg[i]++;
        if(sg[i]==sg[i-1]||sg[i]==sg[i-2]||sg[i]==sg[i-3]||sg[i]==sg[i-4]||sg[i]==sg[i-5]) sg[i]++;
    }
    for(int i=6*k;i<7*k;i++)
    {
        if(sg[i]==sg[i-1]||sg[i]==sg[i-2]||sg[i]==sg[i-3]||sg[i]==sg[i-4]||sg[i]==sg[i-5]||sg[i]==sg[i-6]) sg[i]++;
        if(sg[i]==sg[i-1]||sg[i]==sg[i-2]||sg[i]==sg[i-3]||sg[i]==sg[i-4]||sg[i]==sg[i-5]||sg[i]==sg[i-6]) sg[i]++;
        if(sg[i]==sg[i-1]||sg[i]==sg[i-2]||sg[i]==sg[i-3]||sg[i]==sg[i-4]||sg[i]==sg[i-5]||sg[i]==sg[i-6]) sg[i]++;
        if(sg[i]==sg[i-1]||sg[i]==sg[i-2]||sg[i]==sg[i-3]||sg[i]==sg[i-4]||sg[i]==sg[i-5]||sg[i]==sg[i-6]) sg[i]++;
        if(sg[i]==sg[i-1]||sg[i]==sg[i-2]||sg[i]==sg[i-3]||sg[i]==sg[i-4]||sg[i]==sg[i-5]||sg[i]==sg[i-6]) sg[i]++;
        if(sg[i]==sg[i-1]||sg[i]==sg[i-2]||sg[i]==sg[i-3]||sg[i]==sg[i-4]||sg[i]==sg[i-5]||sg[i]==sg[i-6]) sg[i]++;
    }
    for(int i=k;i<2*k;i++)
        printf("%d ",sg[i]);
    putchar('\n');
    for(int i=2*k;i<3*k;i++)
        printf("%d ",sg[i]);
    putchar('\n');
    for(int i=3*k;i<4*k;i++)
        printf("%d ",sg[i]);
    putchar('\n');
    for(int i=4*k;i<5*k;i++)
        printf("%d ",sg[i]);
    putchar('\n');
    for(int i=5*k;i<6*k;i++)
        printf("%d ",sg[i]);
    putchar('\n');
    for(int i=6*k;i<7*k;i++)
        printf("%d ",sg[i]);
    putchar('\n');
}

*/


Measured memory_bytes: 3768