#include <bits/stdc++.h>
using namespace std;
#define endl ("\n")
#define pi (3.141592653589)
#define mod 1e9+7
#define int long long
#define float double
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define all(c) c.begin(), c.end()
#define min3(a, b, c) min(c, min(a, b))
#define min4(a, b, c, d) min(d, min(c, min(a, b)))
#define rrep(i, n) for(int i=n-1;i>=0;i--)
#define rep(i,n) for(int i=0;i<n;i++)
#define fast ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr);

int32_t main(){
    fast
    int t=1;
    // cin>>t;
    while(t--){
        int a, b, c;cin>>a>>b>>c;
        if(c==0){
            while(true){
                if(a==0){cout<<"Aoki"<<endl;break;}
                else a--;
                if(b==0){cout<<"Takahashi"<<endl;break;}
                else b--;
            }
        }
        else{
            while(true){
                
                if(b==0){cout<<"Takahashi"<<endl;break;}
                else b--;
                if(a==0){cout<<"Aoki"<<endl;break;}
                else a--;
            }
        }
    }
    return 0;
}
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  int m = 0;
  cin >> N;
  vector<tuple<int, int, int>> av(N);
  int a, p, x;
  priority_queue<int, vector<int>, greater<int>> bv;
  for(int i = 0; i < N; i++) {
    cin >> a >> p >> x;
    av.at(i) = make_tuple(x, p, a); }
  for(int i = 0; i < N; i++) {
     if(get<0>(av.at(i)) > get<2>(av.at(i))) 
       bv.push(get<1>(av.at(i))); 
     else
       m++; }
  if(m == N)
    cout << -1 << endl;
  else
    cout << bv.top() << endl; 
}