#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
using namespace std;
void aa(int a,int b)
{
    if(a>b)
        cout<<">";
    else if(a<b)
        cout<<"<";
    else
        cout<<"=";
}
int main()
{
    int a,b,c;
    cin>>a>>b>>c;
    if(c==0)
    cout<<"=";
        else if(c==1)
        aa(a,b);
        else if(c%2==0)
            aa(abs(a),abs(b));
        else if(c>0)
            aa(a,b);
        else
            aa(b,a);
}

#include <bits/stdc++.h>
using namespace std;

int main(){
  long long N,mod=7;
  string S1,S2;
  cin >> N >> S1 >> S2;
  vector<long long> V(N);
  vector<bool> W(N);
  long long pow10 = 1;
  for(int i=N-1;i>=0;i--){
    V[i] = (S1[i]-'0') * pow10;
    V[i] %= mod;
    pow10 *= 10;
    pow10 %= mod;
  }
  for(int i=0;i<N;i++){
    if(S2[i]=='A') W[i] = true;
    else W[i] = false;
  }
  
  vector<vector<bool>> B(N+1,vector<bool>(mod,false));
  B[N][0] = true;
  for(int i=N-1;i>=0;i--){
    if(W[i]){
      for(int j=0;j<mod;j++){
        int x = (V[i]+j) % mod;
        if(B[i+1][j] && B[i+1][x]) B[i][j] = true;
      }
    }
    else{
      for(int j=0;j<mod;j++){
        int x = (V[i]+j) % mod;
        if(B[i+1][j] || B[i+1][x]) B[i][j] = true;
      }
    }
  }
  
  if(B[0][0]) cout << "Takahashi" << endl;
  else cout << "Aoki" << endl;
  return 0;
}
