#include<iostream>
#include<bits/stdc++.h>
#include<vector>
#define vi vector<int>
#define lli long long int
#define fo(i,n) for(int i=1;i<=n;i++)
#define foo(i,n) for(int i=0;i<n;i++)
#define ff first
#define ss second
#define pb push_back
#define vii vector<lli>
#define ok ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
using namespace std;
#define vp vector<pair<lli,lli>>
#include <map> 
#include <stdio.h> 
#include <stdlib.h> 
#include <string.h> 


int main(){
lli v[4],t=0;
foo(j,4) cin>>v[j];
	foo(i,4) t+=v[i];
	if(t%2) {
		cout<<"No";
		return 0;
	}
	lli s = 0;
	lli mask = 15;
	fo(i,mask){
		s=0;
		foo(j,4){
			if(i&(1<<j)){
				s+=v[j];
			}
		}
		if(s==t/2){
			cout<<"Yes";
			return 0;
		}
	}
	cout<<"No";
	return 0;
}
#include <cstdio>
#include <iostream>
#include <cstring>
#include <algorithm>
using namespace std;
# define rep(i,a,b) for(int i=(a); i<=(b); ++i)
inline int readint(){
	int a = 0; char c = getchar(), f = 1;
	for(; c<'0'||c>'9'; c=getchar())
		if(c == '-') f = -f;
	for(; '0'<=c&&c<='9'; c=getchar())
		a = (a<<3)+(a<<1)+(c^48);
	return a*f;
}

const int MaxN = 200005;

int dp[MaxN][7]; // 1: T wins
char opt[MaxN], s[MaxN];

int dfs(int t,int x){
	if(~dp[t][x]) return dp[t][x];
	int &res = dp[t][x];
	if(opt[t] == 'A'){
		if(dfs(t+1,(10*x+s[t]-'0')%7)
			*dfs(t+1,(10*x)%7) == 0)
				return res = 0;
		return res = 1;
	}
	if(opt[t] == 'T'){
		if(dfs(t+1,(10*x+s[t]-'0')%7)
		or dfs(t+1,(10*x)%7) == 1)
			return res = 1;
		return res = 0;
	}
	return -1; // impossible
}

int main(){
	int n = readint();
	scanf("%s %s",s+1,opt+1);
	memset(dp,-1,sizeof(dp));
	rep(i,1,6) dp[n+1][i] = 0;
	dp[n+1][0] = 1;
	puts(dfs(1,0) ? "Takahashi" : "Aoki");
	return 0;
}