#include<bits/stdc++.h>
using namespace std;
int sg(int n,int k){
/*	if(k <= 32000){
		while(1){
			if(n % k == 0)return n / k;
			if(n < k)return 0;
			n = (int)(n * (k-1LL) / k);
		}
	}else{*/
		while(1){
			int hi = n / k, lo = n % k;
			if(lo == 0)return hi;
			if(hi == 0)return 0;
			if(lo < (hi + 1))
				n -= hi+1;
			else
				n = hi * k + lo % (hi + 1);
		}
//	}
}
int main(){
	int t,r=0;
	for(scanf("%d",&t); t--;){
		int n,k;
		scanf("%d%d",&n,&k);
		r^=sg(n,k);
	}
	puts(r?"Takahashi":"Aoki");
	return 0;
}
