#include <bits/stdc++.h>
//#include <bits/extc++.h>

#define int long long
#define ll long long
//#define ull unsigned ll
#define endl "\n"
#define pb push_back
#define ms(v,x) memset(v, x, sizeof v)
#define ff first
#define ss second
#define td(v) v.begin(), v.end()
#define rep(i,a,n) for (int i=(a);i<(n);i++)
#define per(i,a,n) for (int i=(n-1);i>=a;i--)
#define trav(a, x) for(auto& a : x)
#define re(v) {for(auto &_re : v) cin >> _re;}
#define pr(v) {for(auto _pr : v) cout << _pr << " "; cout << endl;}
#define sz(x) (int)(x).size()
#define all(x) x.begin(), x.end()
#define pii pair<int,int>
#define pll pair<ll,ll>
#define vi vector<int>
#define vl vector<ll>
#define eb emplace_back
using namespace std;
using vvi = vector<vi>;
using vvl = vector<vl>;
const ll M = 1e9 + 7;
//const ll M = 998244353;
//const ll M = 1e9 + 9;
//const ll M = 1e6;
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());

ll binpow(ll a, ll b){
  ll res = (a!=0) % M;
  while(b > 0){
    if(b&1) res = res * a % M;
    a = a * a % M;
    b>>=1;
  }
  return res;
}

void solve(){
  ll a, b , c;
  cin >> a >> b >> c;
  cout << (7 - a) + (7 - b) + (7 - c) << endl; 
  
}

int32_t main(){
  ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  //freopen(".in", "r", stdin);
  //freopen(".out", "w", stdout); 
  int t = 1;
  //cin >> t;
  while(t--){
    solve();
  }
  
}
#include<bits/stdc++.h>
using namespace std;
#define LL long long
#define pb push_back
int n, m, i, j;
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cin >> n;
	string s, x;
	cin >> s >> x;
	vector<int>dp(10);
	dp[0] = 1;
	for(i=s.size()-1;i>=0;i--){
		vector<int>tmp(10);
		for(j=0;j<7;j++){
			int ps = j*10+s[i]-'0';
			int p = j*10;
			ps %= 7;
			p %= 7;
			if(x[i]=='A'){
				if(dp[ps]&&dp[p])
					tmp[j] = 1;
			}
			else{
				if(dp[ps]||dp[p]){
					tmp[j] = 1;
				}
			}
		}
		dp = tmp;
	}
	if(dp[0])
		cout << "Takahashi\n";
	else 
		cout << "Aoki\n";
}
