#include <bits/stdc++.h>
using namespace std;
 
int main() {
    int N,S,D;
    int A=0;
    vector<int> X(N);
    vector<int> Y(N);
    vector<int> CX(N);
    vector<int> CY(N);
    cin >> N >> S >> D;
    for (int i=0; i<N; i++){
        cin >> X.at(i) >> Y.at(i);
    }
    for (int i=0; i<N; i++){
        CX.at(i) = S - X.at(i);
        CY.at(i) = D - Y.at(i);
    }
    for (int i=0; i<N; i++){
        if(CX.at(i)>0 && CY.at(i)<0 ){
            A = 1;
            cout << "Yes" << endl;
            break;
        }
    }
    if (A==0){
        cout << "No" << endl;
    }
}
#include <bits/stdc++.h>
using namespace std;
#define all(v) v.begin(),v.end()
#define MP make_pair
#define MT make_tuple
typedef int64_t ll;
#define PA pair<ll,ll>
#define TU tuple<ll,ll,ll>
#define vi vector<ll>
#define vii vector<vector<ll> >
#define rep(i,n) for(ll (i)=0; (i)<(ll)(n); (i)++)
#define rep2(i,m,n) for(ll (i)=(m); (i)<(ll)(n); (i)++)
const ll INF = 1ll<<30;
const ll INF2 = 1ll<<32;

int main() {
  ll n;
  string s,x;
  
  cin >>n>>s>>x;
  vi v(n);
  rep(i,n) v.at(i) = s.at(i)-'0';
  
  //iターン終了時にmod7でjと合同であるとき高橋くんが勝つならtrue
  vector<vector<bool>> dp(n+1,vector<bool>(7,false));
  dp.at(n).at(0) = true;
  
  vi mod_pow_10 = {1,3,2,6,4,5};
  //mod_pow_10.at((n-1-i)%6)
  
  for(ll i=n-1; i>=0; i--) {
    rep(j,7) {
      if(x.at(i)=='T') {
        if( dp.at(i+1).at((ll)(j%7)) || 
           dp.at(i+1).at((ll)((j+v.at(i)* mod_pow_10.at((n-1-i)%6) )%7)) ) dp.at(i).at(j) = true;
      }
      if(x.at(i)=='A') {
        if( dp.at(i+1).at((ll)(j%7)) &&
           dp.at(i+1).at((ll)((j+v.at(i)* mod_pow_10.at((n-1-i)%6) )%7)) ) dp.at(i).at(j) = true;
      }
    }
  }
  
  if(dp.at(0).at(0)) cout <<"Takahashi" << endl;
  else cout <<"Aoki" << endl;
  
}