#include <bits/stdc++.h>
using namespace std;
//#include <atcoder/all>
//using namespace atcoder;
using ll=long long;
#define MOD 998244353
#define INF 1000000000
#define MAX 10000
using Graph=vector<vector<int>>;

int main(){
  int N;
  string S;
  string X;
  cin>>N>>S>>X;

  vector<vector<bool>> dp(N+1,vector<bool>(7,false));
  dp[N][0]=true;
  int res=1;
  for(int i=N-1;i>=0;i--){
    int d=S[i]-'0';
    if(X[i]=='T'){
      for(int j=0;j<7;j++){
        dp[i][j]=dp[i+1][j]|dp[i+1][(j+d*res)%7];
      }
    }else{
      for(int j=0;j<7;j++){
        if(dp[i+1][j]==false||dp[i+1][(j+d*res)%7]==false){
          dp[i][j]=false;
        }else{
          dp[i][j]=true;
        }
      }
    }
    res*=10;
    res%=7;
  }
  if(dp[0][0]==true){
    cout<<"Takahashi"<<endl;
  }else{
    cout<<"Aoki"<<endl;
  }
}

#include<bits/stdc++.h>
#define fort(i,a,b) for(long long i=a;i<=b;i++)
#define forn(i,a,b) for(long long i=a;i>=b;i--)
#define x first
#define y second
#define MP make_pair
#define pb push_back
#define ii pair<long long ,long long >
#define MT make_tuple
#define tp tuple
bool getbit(long long x,long long y)
{
    return (x>>y)&1;
}
void h10toh2()
{
    long long x,n;
    while(1)
    {
        std::cin>>x;
        if (x==-1) return;
        n=log2(x);
        forn(i,n,0)
        std:: cout<<((x>>i)&1);std::cout<<'\n';
    }
}
using namespace std;
long long A,B,C,D;
int main()
{
    //h10toh2();
    //freopen("codeforces.inp","r",stdin);
    //freopen("codeforces.out","w",stdout);
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    cin>>A>>B>>C>>D;
    if (D*C-B>0) cout<<A/(D*C-B)+(A%(D*C-B)!=0)<<'\n';else cout<<"-1\n";
}
