#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<set>
#include<map>
#include<math.h>
#include<unordered_set>
#include<unordered_map>
#include<cassert>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> pll;
typedef vector<ll> vll;
typedef vector<pll> vpll;
#define mp make_pair
#define pb push_back
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define rrep(i,l,r) for(int i=l;i<=r;i++)
#define chmin(a,b) a=min(a,b)
#define chmax(a,b) a=max(a,b)
#define all(x) x.begin(),x.end()
#define unq(x) sort(all(x));x.erase(unique(all(x)),x.end())
#define mod 1000000007
//#define mod 998244353
#define ad(a,b) a=(a+b)%mod;
#define mul(a,b) a=a*b%mod;
void readv(vector<ll> &a,ll n){
	rep(i,n){
		ll x;
		cin>>x;
		a.push_back(x);
	}
}
void outv(vector<ll> &a,ll n){
	rep(i,n){
		if(i>0)cout<<" ";
		cout<<a[i];
	}
	cout<<"\n";
}
ll po(ll x,ll y){
	ll res=1;
	for(;y;y>>=1){
		if(y&1)res=res*x%mod;
		x=x*x%mod;
	}
	return res;
}
ll gcd(ll a,ll b){
	return (b?gcd(b,a%b):a);
}
#define FACMAX 200010
ll fac[FACMAX],inv[FACMAX],ivf[FACMAX];
void initfac(){
	fac[0]=ivf[0]=inv[1]=1;
	for(ll i=1;i<FACMAX;i++)fac[i]=fac[i-1]*i%mod;
	for(ll i=1;i<FACMAX;i++){
		if(i>1)inv[i]=(mod-mod/i*inv[mod%i]%mod)%mod;
		ivf[i]=po(fac[i],mod-2);
	}
}
ll P(ll n,ll k){
	if(n<0||n<k)return 0;
	return fac[n]*ivf[n-k]%mod;
}
ll C(ll n,ll k){
	if(k<0||n<k)return 0;
	return fac[n]*ivf[n-k]%mod*ivf[k]%mod;
}
ll H(ll n,ll k){
	return C(n+k-1,k);
}
ll n,m,a[10010],b[10010],c[110];
vector<ll> eid[110];
ll ans[10010];
bool ans_ok[10010];
vector<ll> g[110];
ll p[110],d[110];
bool vis[110];
void dfs(ll x,ll from,ll dep){
	if(vis[x])return;
	vis[x]=1;
	d[x]=dep;
	p[x]=from;
	for(auto y:g[x])if(y!=from){
		dfs(y,x,dep+1);
	}
}
vector<ll> to[110];
ll dfs2(ll x){
	if(vis[x])return 0;
	ll res=1;
	vis[x]=1;
	for(auto y:to[x])res+=dfs2(y);
	return res;
}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(0);
	cin>>n>>m;
	rep(i,m){
		cin>>a[i]>>b[i];
		a[i]--,b[i]--;
	}
	rep(i,n)cin>>c[i];
	rep(i,m){
		if(c[a[i]]==c[b[i]]){
			eid[c[a[i]]].pb(i);
		}
		else{
			if(c[a[i]]>c[b[i]])ans[i]=0;
			else ans[i]=1;
		}
		ans_ok[i]=0;
	}
	for(int l=1;l<=n;l++){
		rep(i,n)g[i].clear();
		for(auto i:eid[l]){
			g[a[i]].pb(b[i]);
			g[b[i]].pb(a[i]);
		}
		for(int s=0;s<n;s++){
			rep(i,n)vis[i]=0,p[i]=-1,d[i]=-1;
			dfs(s,-1,0);
			vector<ll> comp;
			rep(i,n)if(vis[i])comp.pb(i);
			vector<ll> es;
			for(auto i:eid[l]){
				if(vis[a[i]]==1&&vis[b[i]]==1)es.pb(i);
			}
			rep(i,n)to[i].clear();
			for(auto i:es){
				if(ans_ok[i])continue;
				if(p[a[i]]==b[i]){
					to[b[i]].pb(a[i]);
					ans[i]=1;
				}
				else if(p[b[i]]==a[i]){
					to[a[i]].pb(b[i]);
					ans[i]=0;
				}
				else if(d[a[i]]<d[b[i]]){
					to[b[i]].pb(a[i]);
					ans[i]=1;
				}
				else{
					to[a[i]].pb(b[i]);
					ans[i]=0;
				}
			}
			bool renketsu=1;
			for(auto t:comp){
				for(auto i:comp)vis[i]=0;
				renketsu&=(dfs2(t)==(ll)comp.size());
			}
			if(renketsu){
				for(auto i:es)ans_ok[i]=1;
			}
		}
	}
	rep(i,m){
		cout<<(ans[i]==0?"->":"<-")<<"\n";
	}
}

#include <bits/stdc++.h>

#define     boost            ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);	
#define     pb               push_back	
#define     pob              pop_back	
#define     pof              pop_front	
#define     pf               push_front
#define     mp               make_pair
#define     ff               first
#define     ss               second
#define     endl             "\n"

#define     rep(i,a,b)       for(ll i=a; i<b; i++)
#define     rev(i,a,b)       for(ll i=a; i>=b; i--)

#define     decimal(n)       fixed << setprecision(n) 
#define     all(v)           v.begin(), v.end() 
#define     rall(v)          v.rbegin(), v.rend()
#define     sz(v)            v.size()
#define     total_sum(v)     accumulate(all(v),0)  

#define     make_unique(v)   v.erase(unique(all(v)),v.end())
#define     n_p(v)           next_permutation(all(v))
#define     p_p(v)           prev_permutation(all(v))
	

#define     for_each(it, X)  for(__typeof((X).begin()) it = (X).begin(); it != (X).end(); it++)


#define     re               return

using namespace std;

typedef     long long              ll;
typedef     unsigned long long     ull;
typedef     pair < int, int >      pii;
typedef     pair < ll, ll >        pll;
typedef     vector < pii >         vii;
typedef     vector < pll >         vll;
typedef     vector < int >         vi;
typedef     vector < ll >          vl;
typedef     vector < string >      vs;


ll gcd ( ll , ll );

ll lcm ( ll  , ll );

bool isPrime( ll );

ll power( ll , ll );

ll fact( ll );

void sieve_of_eratosthenes ( ll , vl &a); 


//---------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------

void solve()
{
	ll a,b,c;
	cin>>a>>b>>c;
	
	if(c) {
		
		if(b<=a) {
			c=1;
		}
		
		else
		c=0;	
		
	}
	
	else {
		if(a<=b) {
			c=0;
		}
		
		else
		c=1;
	}
	
	if(c) {
		cout<<"Takahashi";
	}
	
	else
	cout<<"Aoki";
}
 
int main()
{
    boost;
    ll t=1;
//	cin>>t;
    
	while(t--)
    {
    	solve();
    }
  
}

//---------------------------------------------------------------------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------

// HCF

ll gcd ( ll a , ll b )  {
	
	return __gcd ( a , b ) ;
	
	/*
	
	if ( a==0 )
	return b ;
	
	return gcd ( b%a , a ) ;	
	
	*/
}

// LCM

ll lcm ( ll a , ll b )  {
	
	return ( a * b ) / ( __gcd ( a , b ) ) ;

}

// PRIME 

bool isPrime( ll n )
{
    ll i=2;
    
    for( i ; i*i<=n ; i++) 
	{
        if( n % i == 0)
        return false;
    }
    
    return true;
}

// POWER

ll power( ll b , ll a ) {
	
	if(a==0) {
		return 1;
	}
	
	ll c=1;
	
	rep(i,0,a) {
		c*=b;
	}
	
	return c;
	
}

// FACTORIAL

ll fact(ll n) {
	
	ll c=1;
	
	while(n>1) {
		c*=n;
		n--;
	}
	
	return c;	
	
}

// SIEVE of ERATOSTHENES

void sieve_of_eratosthenes (ll n, vl &a) {
	
	a[1]=0;
	
	for(ll i=2; i*i<=n ; i++) {
		if(a[i]==1) {
			for(ll j=i+i; j<=n ; j+=i) {		
				a[j]=0;
			}
		}
	}
	
}

//-------------------------------------------------------------*/--------------------------------------------------------------------------------
//---------------------------------------------------------------------------------------------------------------------------------------------
