#pragma GCC optimize("Ofast")
//#ifndef ONLINE_JUDGE 
//#define _GLIBCXX_DEBUG
//#endif
#ifdef ONLINE_JUDGE 
#include <atcoder/all>
#endif
#include <bits/stdc++.h>
#include <chrono>
#include <random>
#include <math.h>
#include <complex>
 
 
using namespace std;
#ifdef ONLINE_JUDGE 
using namespace atcoder;
#endif
#define rep(i,n) for (int i = 0;i < (int)(n);i++)
using ll = long long;
#ifdef ONLINE_JUDGE 
//using mint = modint998244353;
//using mint = modint;
using mint = modint1000000007;
#endif
const ll MOD=1000000007;
//const ll MOD=998244353;
const long long INF = 1LL << 60;
const double pi=acos(-1.0);
int dx[9] = {1, 0, -1, 0, 1, 1, -1, -1, 0};
int dy[9] = {0, 1, 0, -1, 1, -1, -1, 1, 0};
 
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
 
 
 
int main()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  // cout << fixed << setprecision(15);
 
  ll H,W; cin>>H>>W;
  vector<vector<int>> A(H,vector<int>(W));
  
  rep(i,H) rep(j,W) {
    char c; cin>>c;
    A[i][j]=2*(c=='+')-1;
  }
  
  vector<vector<ll>> dp(H,vector<ll>(W,-INF));
  for(int i=H-1;i>=0;i--) for(int j=W-1;j>=0;j--) {
    if(i==H-1&&j==W-1) {
      dp[i][j]=0;
      continue;
    }
    
    if(i<H-1) chmax(dp[i][j],-dp[i+1][j]+A[i+1][j]);
    if(j<W-1) chmax(dp[i][j],-dp[i][j+1]+A[i][j+1]);
    
  }
  
  if(dp[0][0]>0) cout<<"Takahashi\n";
  else if(dp[0][0]<0) cout<<"Aoki\n";
  else cout<<"Draw\n";
  /*
  rep(i,H) {
    rep(j,W) cout<<dp[i][j]<<' ';
    cout<<'\n';
  }
  */
  return 0;
}
#include <iostream> // cout, endl, cin
#include <cmath> //sqrt pow
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // dequef
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <climits>

#define rep(i, n) for (int i = 0; i < n; i++)
using ll = long long;
using ld = long double;
#define vi vector<int>
#define vvi vector<vi>
#define vl vector<ll>
#define pii pair<int, int>
#define pll pair<ll, ll>
#define all(a) (a).begin(), (a).end()
#define mod 1000000007
using namespace std;
const int inf = -1000000000;
int main(){
  int n,m;
  cin >> n >> m;
  vi a(n);
  vector<pii> small(n);
  rep(i, n){
    cin >> a[i];
    small[i] = make_pair(a[i], i);
  }
  vvi root(n);
  rep(i, m){
    int a, b;
    cin >> a >> b;
    root[a - 1].push_back(b - 1);
  }
  sort(all(small));
  int ans = inf;
  queue<int> que;
  vi checked(n, -1);
  rep(i, n){
    int buy, start;
    tie(buy, start) = small[i];
    if(checked[start] != -1) continue;
    checked[start] = 0;
    que.push(start);
    while(!que.empty()){
      int pos = que.front();
      que.pop();
      for(int x : root[pos]){
        if(checked[x] != -1) continue;
        checked[x] = 1;
        ans = max(ans, a[x] - buy);
        que.push(x);
      }
    }
  }
  if(ans != inf){
    cout << ans << endl;
    return 0;
  }
  //頂点の番号が小さい<=>値が大きい
  checked = vi(n, -1);
  for(int i = n - 1; i >= 0; i--){
    int buy, start;
    tie(buy, start) = small[i];
    if(checked[start] != -1) continue;
    checked[start] = 0;
    que.push(start);
    while(!que.empty()){
      int pos = que.front();
      que.pop();
      for(int x : root[pos]){
        ans = max(ans, a[x] - buy);
        que.push(x);
      }
    }
  }
  cout << ans << endl;
}