#pragma GCC optimize("Ofast", "unroll-loops")

#include <bits/stdc++.h>

using namespace std;

using ll = long long;
using ld = long double;

int N;
string S;
string X;

void input(void){
	cin >> N >> S >> X;
}

map<pair<int, int>, int> memo;

bool canTWin(int i, int m){
	if (i == N) return (m == 0);
	if (memo[{i, m}] > 0)
		return memo[{i, m}] == 1;
	char p = X[i];
	int d = (int)(S[i] - '0');
	if (p == 'T'){
		bool ret = canTWin(i + 1, m * 10 % 7) || canTWin(i + 1, (m * 10 + d) % 7);
		memo[{i, m}] = ret ? 1 : 2;
		return ret;
	}
	bool ret = canTWin(i + 1, m * 10 % 7) && canTWin(i + 1, (m * 10 + d) % 7);
	memo[{i, m}] = ret ? 1 : 2;
	return ret;
}

int main(void){
	input();
	cout << (canTWin(0, 0) ? "Takahashi" : "Aoki") << endl;
	return 0;
}
#pragma GCC optimize("Ofast")
#pragma GCC target("avx,avx2,fma")
#pragma GCC optimization("unroll-loops")

#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define eb emplace_back
#define mk make_pair
#define fi first
#define se second
#define mset(a,b) memset(a, b, sizeof(a))
#define dbg(x) cout << "[" << #x << "]: " << x << endl;
#define forn(i,n) for(int i=0; i < n;i++)
#define forab(i,a,b) for(int i = a; i <= b; i++)
#define forba(i,b,a) for(int i = b; i >= a; i--)
#define each(val, v) for(auto val : v)
#define abs(u) (u >= 0 ? u : -u)

using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using vi = vector<int>;
using vl = vector<ll>;

const int MAXN = 2e5 + 5;
const int INF = 0x3f3f3f3f;
const int MOD = 998244353;

int add(int a, int b){
    a += b;

    if( a >= MOD) a -= MOD;

    if(a < 0) a += MOD;

    return a;
}

int mul(int a, int b){
    int ret = (1LL * a * b)%MOD;

    return ret;
}

int pw(int a, int n){
    int ret = 1;

    while(n > 0){
        if(n&1 == 1){
            ret = mul(ret, a);
        }
        a = mul(a,a);
        n = n>> 1;
    }

    return ret;
}

int inv(int a){
    return pw(a,MOD-2);
}

int divide(int a, int b){
    return mul(a, inv(b));
}


void solve(){

    int a,b,c;
    cin >> a >> b >> c;


    int soma_a = mul( a, divide(a+1,2) );
    int soma_b = mul( b, divide(b+1,2) );
    int soma_c = mul( c, divide(c+1,2) );

    int ans = mul( soma_a, mul(soma_b, soma_c) );

    cout << ans << '\n';

}

int main(){

    ios::sync_with_stdio(false); cin.tie(NULL);

    int t = 1;
    //cin >> t;
    while(t--){
        solve();
    }

    return 0;
}