
// C++ (GCC9.2.1) AtCoder
/*
Ctrl+Option+N で　実行

*/

#include <bits/stdc++.h>
#define INF 100000000000
#define MOD 1000000007
#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define all(x) (x).begin(),(x).end()
#define print(x) cout << (x) << endl;

typedef long long ll;

using namespace std;

ll m = 7;

long long pow(long long a,long long n){
  long long ret=1;
  for(;n>0;n>>=1,a=a*a%m){
    if(n%2==1){
      ret=ret*a%m;

    }
  }
  return ret;
}

long long inv(long long a){
  return pow(a,m-2);
}


int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr); 
  ll N; cin>>N;
  string S; cin>>S;
  string X; cin>>X;
/*
  S += "0";
  X += "T";
  N++;
  */

  vector <int> Tvict(7,0);
  vector <int> Avict(7,1); 
  Tvict[0] = 1;
  Avict[0] = 0;

  for(int i=N-1;i>=1;i--){
    vector <int> nextTvict(7,0);
    vector<int> nextAvict(7,0);
    int special = S[i] - '0';

    if(X[i] == 'T'){
      for(int a=0;a<7;a++){
        if(Tvict[a] == 0) continue;
        ll tmp = (a - special + 777) % 7;
        
        nextTvict[tmp * inv(10) % 7]++;
      }

       for(int a=0;a<7;a++){
        if(Tvict[a] == 0) continue;
        ll tmp = (a - 0 + 777) % 7;
        
        nextTvict[tmp * inv(10) % 7]++;
      }

      REP(i,7){
        if(nextTvict[i] == 0) nextAvict[i] = 1;
        else nextAvict[i] = 0;
      }
      
    } else {
         for(int a=0;a<7;a++){
        if(Avict[a] == 0) continue;
        ll tmp = (a - special + 777) % 7;
        
        nextAvict[tmp * inv(10) % 7]++;
      }

       for(int a=0;a<7;a++){
        if(Avict[a] == 0) continue;
        ll tmp = (a - 0 + 777) % 7;
        
        nextAvict[tmp * inv(10) % 7]++;
      }

      REP(i,7){
        if(nextAvict[i] == 0) nextTvict[i] = 1;
        else nextTvict[i] = 0;
      }
    
    }

    Avict = nextAvict;
    Tvict = nextTvict;
    /*

    for(auto i : Avict){
      cout<<i<<" ";
    }
    cout<<endl;
    for(auto i : Tvict){
      cout<<i<<" ";
    }
    cout<<endl;
    */



  }


  if(X[0] == 'T'){
    ll spe = S[0] - '0';

    if( (Tvict[0] > 0) or (Tvict[spe] > 0)) print("Takahashi")
    else print("Aoki")
  } else {
        ll spe = S[0] - '0';

    if(Avict[0] > 0 or Avict[spe] > 0) print("Aoki")
    else print("Takahashi")
  }
  return 0;
}
#include<bits/stdc++.h>
#define double long double
#define maxn 100010
using namespace std;
int read()
{
	int s=0,w=1;
	char ch=getchar();
	while(ch<'0'||ch>'9') {if(ch=='-') w=-1;ch=getchar();}
	while(ch>='0'&&ch<='9') s=(s<<3)+(s<<1)+(ch^48),ch=getchar();
	return s*w;
}
int n,m,K,v[maxn];
double k[maxn],b[maxn],sk[maxn],sb[maxn];
#define ABS(x) ((x)<0?-(x):(x))
signed main()
{
	n=read(),m=read(),K=read();
	for(int i=1,x;i<=K;i++) v[x=read()]=1,k[x]=1;
	for(int i=n-1;~i;i--)
	{
		if(!v[i]) k[i]=(sk[i+1]-sk[i+m+1])/m,b[i]=(sb[i+1]-sb[i+m+1])/m+1;
		sk[i]=sk[i+1]+k[i],sb[i]=sb[i+1]+b[i];
	}
	if(ABS(k[0]-1)<1e-7) cout<<-1<<'\n';
	else cout<<fixed<<setprecision(10)<<b[0]/(1-k[0])<<'\n';
	return 0;
}