#include<bits/stdc++.h>
using namespace std;
typedef long long ll;

int h, w, a, b;
//vector<vector<vector<int>>>dp;

int calc(int x, int y, int rem_a, int rem_b, int mask){
     if(x==h && y==0) return mask==0 && rem_a==0 && rem_b==0;
     if(y==w) return calc(x+1, 0, rem_a, rem_b, mask);

     //if(x==h) cout << y << endl;
     int tmp;
     int res=0;

     if(mask & (1<<y)){
          tmp=mask;
          tmp ^= (1<<y);
          res=calc(x, y+1, rem_a, rem_b, tmp);
          return res;
     }

     if(rem_b){
          //1*1
          tmp=mask;
          res+=calc(x, y+1, rem_a, rem_b-1, tmp);
     }

     if(rem_a){
          //2*1
          tmp=mask;
          tmp |= (1<<y);
          res+=calc(x, y+1, rem_a-1, rem_b, tmp);

          //1*2
          if(y+1<w && (mask & (1<<(y+1)))==0){
               tmp=mask;
               res+=calc(x, y+2, rem_a-1, rem_b, tmp);
          }
     }

     //cout << "For "<< x << " "  << y << " " << rem_a << " " << rem_b << ": " << mask << " " << res << endl;
     return res;
}

int main(){
     int i, j, k;
     cin >> h >> w >> a >> b;
     //if(h<w) swap(h, w);
     //memset(dp, -1, sizeof dp);
     cout << calc(0, 0, a, b, 0) << endl;
}

#include<bits/stdc++.h>
using namespace std;

#define all(x) (x).begin(),(x).end()
#define pb push_back
#define pf push_front
#define sz(x) (int)(x).size()
#define lb lower_bound 
#define ub upper_bound 
#define mp make_pair
#define fi first
#define se second
#define setbits(x) __builtin_popcount(x)
#define zerobits(x) __builtin_ctz(x)
#define setbitsll(x) __builtin_popcountll(x)
#define zerobitsll(x) __builtin_ctzll(x)
#define ps(x,y) fixed<<setprecision(y)<<x

typedef vector<int> vi;
typedef long long ll;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef unsigned long long ull;
typedef long double ld;
typedef map<int,int> mii;

const int MOD = 1e9+7;
const ld PI = acos((ld)-1);
const int maxN = 2e5+1;

int dp[maxN][7],n;
string str,turn;

int go (int idx,int rem) {
	if (idx == n) {
		if (rem == 0) {
			return 1;
		} else {
			return 0;
		}
	}
	int& ret = dp[idx][rem];
	if (ret != -1) return ret;
	ret = 0;
	int nextRem1 = (rem*10+0)%7;
	int nextRem2 = (rem*10+str[idx]-'0')%7;
	if (turn[idx] == 'T') {
		ret = (go(idx+1,nextRem1) || go(idx+1,nextRem2));
	} else {
		ret = (go(idx+1,nextRem1) && go(idx+1,nextRem2));
	}
	return ret;

}

//dp[idx][rem]= Takahashi wins if we are at position "idx" with remainder "rem" 
void solve () {
	memset(dp,-1,sizeof(dp));
	cin >> n;
	cin >> str >> turn;
	if (go(0,0)) {
		cout << "Takahashi\n";
	} else {
		cout << "Aoki\n";
	}
}

int main () {

#ifndef ONLINE_JUDGE
	freopen("input1.txt","r",stdin);
	freopen("output1.txt","w",stdout);
#endif

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	solve();
	return 0;
}

 