#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=5e3+5;
const int mod=998244353;
int n,m;
int dp[15][N];
int fac[N],invf[N];
inline int po(int x,int k){
	int ret=1;
	while(k){
		if(k&1) ret=1ll*ret*x%mod;
		x=1ll*x*x%mod;
		k>>=1;
	}
	return ret;
}
inline int C(int x,int k){
	if(x<k) return 0;
	return 1ll*fac[x]*invf[k]%mod*invf[x-k]%mod;
}
int main(){
	int i,j,k;
	fac[0]=1;
	for(i=1;i<N;i++) fac[i]=1ll*fac[i-1]*i%mod;
	invf[N-1]=po(fac[N-1],mod-2);
	for(i=N-2;i>=0;i--) invf[i]=ll(i+1)*invf[i+1]%mod;
	cin>>n>>m;
	dp[0][0]=1;
	for(i=0;(1<<i)<=m;i++){
		for(j=0;j*(1<<i)<=m&&j<=n;j+=2){
			for(k=j*(1<<i);k<=m;k++)
				dp[i+1][k]=(dp[i+1][k]+1ll*dp[i][k-j*(1<<i)]*C(n,j))%mod;
		}
	}
	cout<<dp[i][m];
	return 0;
}
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef pair<int,int> PII;
const int N=2e5+5;
int n;
char s[N],x[N];
int f[N][8];
int dp(int i,int k){
	if(i==n)	return (k==0);
	if(f[i][k]!=-1)	return f[i][k];
	int ans;
	if(x[i]=='T')	ans=dp(i+1,(k*10+s[i]-'0')%7)|dp(i+1,(k*10)%7);
	else	ans=dp(i+1,(k*10+s[i]-'0')%7)&dp(i+1,(k*10)%7);
	return f[i][k]=ans;
}
int main(){
	memset(f,-1,sizeof(f));
	scanf("%d",&n);
	scanf("%s%s",s,x);
//	cout<<s<<endl<<x<<endl;
	if(dp(0,0))	puts("Takahashi");
	else	puts("Aoki");
	return 0;
}