#include<iostream>
using namespace std;
int N;
string S,X;
int dp[2<<17][7];
bool dfs(int t,int k)
{
	if(dp[t][k]!=0)
	{
		return dp[t][k]>0;
	}
	bool win=false;
	if(t==N)
	{
		if(k==0)win=true;
	}
	else if(X[t]=='T')
	{
		if(dfs(t+1,k*10%7))win=true;
		else if(dfs(t+1,(k*10+S[t]-'0')%7))win=true;
	}
	else
	{
		if(!dfs(t+1,k*10%7))win=true;
		else if(!dfs(t+1,(k*10+S[t]-'0')%7))win=true;
		win=!win;
	}
	dp[t][k]=win?1:-1;
	return win;
}
main()
{
	cin>>N>>S>>X;
	cout<<(dfs(0,0)?"Takahashi":"Aoki")<<endl;
}

#include <iostream>

using namespace std;

const int kMaxN = 2e5;

int n, s[kMaxN], x[kMaxN];
int f[kMaxN][7];
string tmp;

int main() {
  ios_base::sync_with_stdio(NULL);
  cin.tie(nullptr), cout.tie(nullptr);

  cin >> n >> tmp;
  f[n][0] = 1;
  for (int i = 0; i < n; i++) {
    s[i] = tmp[i] - '0';
  }
  cin >> tmp;
  for (int j = 0; j < n; j++) {
    x[j] = tmp[j] == 'T';
  }
  for (int i = n - 1; i >= 0; i--) {
    for (int j = 0; j < 7; j++) {
      f[i][j] = x[i] ^ (f[i + 1][j * 10 % 7] != x[i] && f[i + 1][(j * 10 + s[i]) % 7] != x[i]);
    }
  }
  cout << (f[0][0] ? "Takahashi" : "Aoki") << endl;
  return 0;
}