#include <bits/stdc++.h>

using namespace std;

typedef pair<int, int> pr;
typedef vector<int> vec;
typedef long long int lli;

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define TEST int T; cin >> T; while(T--)

#define rep(i,n) for (auto i = 0; i < n; ++i) 
#define repk(i,k,n) for (auto i = k; i < n; ++i) 
#define repr(i,k,n) for (auto i = k; i >= n; --i) 

void solve() {
    int a,b,c;
    cin >> a >> b >> c;
    if(a>b) cout << "Takahashi" << endl;
    else if(a<b) cout << "Aoki" << endl;
    else {
        if(c == 0) cout << "Aoki" << endl;
        else cout << "Takahashi" << endl; 
    }   
}

int main() {
    std::ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    // TEST {
        solve();
    // }
}
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
#define all(v) v.begin(),v.end()
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;
template<class T> void chmin(T &a,const T &b){if(a>b) a=b;}
template<class T> void chmax(T &a,const T &b){if(a<b) a=b;}

const ll INF=1e18;

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);

  int N,M;
  cin>>N>>M;
  vector<int> A(M),B(M);
  vector<ll> C(M);
  rep(i,M){
    cin>>A[i]>>B[i]>>C[i];
    A[i]--;B[i]--;
  }

  vector<vector<pair<int,ll>>> g(N);
  rep(i,M) g[A[i]].push_back(mkp(B[i],C[i]));

  vector<ll> ans(N,-1);
  for(int st=0;st<N;st++){
    vector<ll> dist(N,INF);
    priority_queue<pair<ll,int>,vector<pair<ll,int>>,greater<pair<ll,int>>> PQ;
    for(auto e:g[st]){
      int nex=e.first;
      ll neco=e.second;
      if(dist[nex]>neco){
        dist[nex]=neco;
        PQ.push(mkp(neco,nex));
      }
    }

    while(!PQ.empty()){
      auto f=PQ.top();
      PQ.pop();

      int now=f.second;
      ll cost=f.first;
      if(dist[now]<cost) continue;
      for(auto e:g[now]){
        int nex=e.first;
        ll neco=e.second;
        if(dist[nex]>dist[now]+neco){
          dist[nex]=dist[now]+neco;
          PQ.push(mkp(dist[nex],nex));
        }
      }
    }
    if(dist[st]!=INF) ans[st]=dist[st];
  }

  for(auto d:ans) cout<<d<<"\n";

  return 0;
}
