#include <bits/stdc++.h>
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;
using ll = long long;

int main() {
	int n, m;
	cin >> n >> m;
	set<int> a, b, ans;
	rep(i, n) {
		int v;
		cin >> v;
		a.insert(v);
	}
	rep(i, m) {
		int v;
		cin >> v;
		b.insert(v);
	}
	for (auto v : a) {
		bool which = false;
		for (auto x : b) {
			if (v == x) which = true;
		}
		if (!which) ans.insert(v);
	}
	for (auto v : b) {
		bool which = false;
		for (auto x : a) {
			if (v == x) which = true;
		}
		if (!which) ans.insert(v);
	}
	int count = 0;
	for (auto v : ans) {
		count++;
		cout << v;
		if (count < ans.size()) cout << " ";
	}
	cout << endl;
}
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using vl = vector<ll>;
#define rep(i,n) for(int i=0;i<(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define rrep1(i,n) for(int i=(n);i>0;i--)
#define fore(i_in,a) for (auto& i_in: a)
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define fio() cin.tie(nullptr);ios::sync_with_stdio(false);
#define DEBUG_CTN(v) cerr<<#v<<":";for(auto itr=v.begin();itr!=v.end();itr++) cerr<<" "<<*itr; cerr<<endl
template<class T> bool chmax(T &a, const T &b) {if (a<b) { a = b; return true; } return false;}
template<class T> bool chmin(T &a, const T &b) {if (a>b) { a = b; return true; } return false;}
template<class T> void print(const T &t) { cout << t << "\n"; }
const ll INF = 1LL << 62;
const int iINF = 1 << 30;

int n;
string s,t;

int main() {
    fio(); cin>>n>>s>>t;
    vector<set<int>> dp(n+1);
    dp[n].insert(0);
    rrep(i,n){
        int c = s[i]-'0';
        if(t[i]=='T'){
            rep(j,7) {
                int x = (10*j+c)%7;
                int y = (10*j)%7;
                if(dp[i+1].count(x)!=0 or dp[i+1].count(y)!=0) dp[i].insert(j);
            }
        } else {
            rep(j,7) {
                int x = (10*j+c)%7;
                int y = (10*j)%7;
                if(dp[i+1].count(x)!=0 and dp[i+1].count(y)!=0) dp[i].insert(j);
            }
        }
    }
    print(dp[0].count(0)!=0?"Takahashi":"Aoki");
}
