#ifdef _LOCAL
#define _GLIBCXX_DEBUG
#endif
#include <bits/stdc++.h>
typedef long long ll;
using namespace std;

static const ll MOD = 998244353ll;

long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

ll add(ll a, ll b) { return (a + b) % MOD; }
ll mul(ll a, ll b) { return (a * b) % MOD; }
ll di(ll a, ll b) {
    return a * modinv(b, MOD) % MOD;
}

ll solve(ll a, ll b, ll c) {
    ll cc = di(mul(add(1ll, c), c), 2ll);
    ll bb = di(mul(add(1ll, b), b), 2ll);
    ll aa = di(mul(add(1ll, a), a), 2ll);
    return mul(mul(cc, bb), aa);
}

#ifndef _LOCAL
int main() {
    ll a, b, c;
    cin >> a >> b >> c;
    cout << solve(a, b, c) << endl;
}
#endif
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); i++)
#define per(i,n) for (int i=n-1; i>=0; i--)
using namespace std;
using ll = long long;
using P = pair<int,int>;

int main(){
	int n;
	string s, x;
	cin>>n>>s>>x;

	vector<bool> dp(7, false), ndp(7);
	dp[0]=true;
	per(i, n){
		if(x[i]=='A'){
			rep(j, 7) ndp[j]=true;
			rep(j, 7){
				if(dp[j*10%7]==false) ndp[j]=false;
				if(dp[(j*10 + s[i]-'0')%7]==false) ndp[j]=false;
			}
		}
		else{
			rep(j, 7) ndp[j]=false;
			rep(j, 7){
				if(dp[j*10%7]==true) ndp[j]=true;
				if(dp[(j*10 + s[i]-'0')%7]==true) ndp[j]=true;
			}
		}
		swap(dp, ndp);
	}

	if(dp[0]) cout<<"Takahashi"<<endl;
	else cout<<"Aoki"<<endl;
	return 0;
}
