#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ld = long double;

#define pb push_back
#define mp make_pair
#define sz(s) (int)s.size()
#define pii pair<int, int>
#define pll pair<ll, ll>
#define all(a) a.begin(),a.end()
#define allr(a) a.rbegin(),a.rend()
#define rep(i,a,b) for(int i = a; i < b; i++)
#define in insert
#define ff first
#define ss second
#define vt vector
#define ub upper_bound
#define lb lower_bound
#define repp(i,n,a) for(int i = n; i >= a; i--)
#define re(a,n) rep(i,0,n) cin>>a[i];
const long double pi = 2 * acos(0.0);
const int mod = 1e9 + 7;
const int maxn = 2100;
const int inf=2e9;

int n,m;
int a[maxn][maxn];
int dp[maxn][maxn];
int f(int i, int j){
    if(dp[i][j]!=-inf)
        return dp[i][j];
    if(i+1<n)
        dp[i][j]=max(dp[i][j],a[i+1][j]-f(i+1,j));
    if(j+1<m)
        dp[i][j]=max(dp[i][j],a[i][j+1]-f(i,j+1));
    return dp[i][j];
}

void solve(){
    cin>>n>>m;
    rep(i,0,n){
        string s;
        cin>>s;
        rep(j,0,m){
            dp[i][j]=-inf;
            a[i][j]=(s[j]=='+'?1:-1);
        }
    }
    dp[n-1][m-1]=0;
    f(0,0);
    // rep(i,0,n){
    //     rep(j,0,m){
    //         cout<<dp[i][j]<<' ';
    //     }cout<<'\n';
    // }
    if(dp[0][0]>0)
        cout<<"Takahashi\n";
    else if(dp[0][0]<0)
        cout<<"Aoki\n";
    else
        cout<<"Draw\n";




    

    return;
}

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

    
    int t = 1;
    //cin >> t;
    while(t--){
        solve();
    }
    
    
    return 0;
}
#include<iostream>
#include<vector>
#include<cmath>
using namespace std;
#define ll long long
ll maxn[200005];
ll minn[200005];
ll dp[200005][2];
ll n;
int main(){
    cin>>n;
    for (int i=0;i<200005;i++) {
        maxn[i]=-1e10;
        minn[i]=1e10;
    }
    for (int i=0;i<n;i++){
        ll x,c;cin>>x>>c;
        if (x>maxn[c]) maxn[c]=x;
        if (x<minn[c]) minn[c]=x;
    }
    vector<ll> yes;
    yes.push_back(0);
    maxn[0]=0; minn[0]=0;
    for (int i=0;i<=n;i++) {
        if (maxn[i]!=-1e10) yes.push_back(i);
    }
    yes.push_back(200001);
    maxn[200001]=0; minn[200001]=0;
 
    int len=yes.size();
    //dp[yes[0]][0]=maxn[yes[0]]+(maxn[yes[0]]-minn[yes[0]]);
    //dp[yes[0]][1]=maxn[yes[0]];
    
    for (int i=1;i<len;i++){
        ll now=yes[i];
        ll last=yes[i-1];
        dp[now][0]=min(dp[last][0]+ abs(maxn[now]-minn[last])  + (maxn[now]-minn[now]),
                       dp[last][1]+ abs(maxn[last]-maxn[now])  + (maxn[now]-minn[now]));
        dp[now][1]=min(dp[last][0]+ abs(minn[now]-minn[last])  + (maxn[now]-minn[now]),
                       dp[last][1]+ abs(maxn[last]-minn[now])  + (maxn[now]-minn[now]));
    }
    /*for (int i=0;i<len;i++){
        cout<<dp[yes[i]][0]<<"  "<<dp[yes[i]][1]<<endl;
    }*/
    cout<<min(dp[yes[len-1]][0],dp[yes[len-1]][1])<<endl;
 
}