#include <algorithm>
#include <cstdio>
#include <functional>
#include <iostream>
#include <cfloat>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <time.h>
#include <complex>
#include <vector>
#include <limits>
#include <iomanip>
#include <cassert>
#include <numeric>
#include <chrono>
#include <random>

using namespace std;

typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;

#define debug(x) cerr << #x << " = " << (x) << endl;
#define debug_pii(x) cerr << "(" << x.first << "," << x.second << ")";
#define rep(i, n) for(int i = 0;i < n;i++)
#define pb push_back
#define F first
#define S second

// template<typename _Ty1, typename _Ty2>
// ostream& operator<<(ostream& _os, const pair<_Ty1, _Ty2>& _p) {
//     _os << '(' <<_p.first << ',' << _p.second << ')';
//     return _os;
// }
//
// template<typename _Ty1, typename _Ty2>
// istream& operator>>(istream& _is, pair<_Ty1, _Ty2>& _p) {
//     _is >> _p.first >> _p.second;
//     return _is;
// }

int n;
string s,x;

char dp[(int)2e5+10][10];

char winner(int i, int mod7) {

  if(i == n) {
    if(mod7 == 0) return 'T';
    return 'A';
  }

  if(dp[i][mod7] == 'A' || dp[i][mod7] == 'T') return dp[i][mod7];

  int nmod7 = (mod7*10)%7;
  char w1 = winner(i+1,nmod7);
  nmod7 = (nmod7+(s[i]-'0'))%7;
  char w2 = winner(i+1,nmod7);

  char winner;
  if(x[i] == 'T') {
    if(w1 == 'T' || w2 == 'T') winner = 'T';
    else winner = 'A';
  } else {
    if(w1 == 'A' || w2 == 'A') winner = 'A';
    else winner = 'T';
  }

  return dp[i][mod7]=winner;
}

void solve() {
  cin>>n>>s>>x;
  cout << (winner(0,0) == 'T'? "Takahashi":"Aoki") << endl;
}

// 1-->1
// 2-->2
// 3-->3

int main() {

 // freopen("input.in","r",stdin);
 // freopen("output.out","w",stdout);
 // cout << fixed << setprecision(15);

 ios_base::sync_with_stdio(false);
 cin.tie(nullptr);
 int t = 1;
 // cin >> t;
 while (t--) {
   solve();
 }

 return 0;
}

#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int64_t A,B,C;
  cin >> A >> B >> C;  
  
 // cout << C%2  << endl;
  
  if (A < 0 || B < 0){
  	if(C%2 == 0){
    	if(abs(A)  > abs(B)) cout << ">" << endl;
  		 else if (abs(A)  <  abs(B))cout << "<" << endl;
  		 else cout << "=" << endl;
     	}
     else{
    	if(A > B) cout << ">" << endl;
  		else if (A  <  B)cout << "<" << endl;
  		else cout << "=" << endl;
     	}
     }
   else{
   	if(A  > B )cout << ">" << endl;
  	else if (A  <  B)cout << "<" << endl;
  	else cout << "=" << endl;
    }
 
}