#include<bits/stdc++.h>
using namespace std;
#define INIT  ios_base :: sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
#define mp make_pair
#define pb push_back
#define ft first
#define sc second
#define ll long long
#define pii pair<int, int>
#define count_bits __builtin_popcount
#define int ll

int t, n, m, k, a[300010], q, l, r;
int y, x;

map<int,int> h;


int rec(int n){
    if(n==1){return x-1;}
    if(n==0){return x;}
    if(h[n]!=0){
        return h[n];
    }
    //cout<<n<<" "<<flush;
    h[n]=min(abs(x-n), min(rec((n-(n%2) )/2  ),rec((n+(n%2) )/2 ) )+1+(n%2) );
    return h[n];
}

int32_t main(){
INIT
cin>>x>>y;
cout<<rec(y);


return 0;
}




#include<cstdio>
#include<string>
#include<iostream>
#include<algorithm>
using namespace std;

#define fi first
#define se second
#define rep(i, l, r) for(int i=(l), i##_end_=(r); i<=i##_end_; ++i)
#define fep(i, l, r) for(int i=(l), i##_end_=(r); i>=i##_end_; --i)
typedef long long ll;
template<class T>inline T fab(T x){ return x<0? -x: x; }
template<class T>inline T readin(T x){
    x=0; int f=0; char c;
    while((c=getchar())<'0' || '9'<c) if(c=='-') f=1;
    for(x=(c^48); '0'<=(c=getchar()) && c<='9'; x=(x<<1)+(x<<3)+(c^48));
    return f? -x: x;
}

const int maxn=2000;
const int inf=maxn*2+5;
const int dir[][2]={{0, 1}, {1, 0}};

int n, m;
char a[maxn+5][maxn+5];
int f[maxn+5][maxn+5][2];

inline int inside(int x, int y){
    return 0<x && x<=n && 0<y && y<=m;
}

int getf(int i, int j, int k){
    if(i==n && j==m) return 0;
    if(f[i][j][k]<inf) return f[i][j][k];
    int ti, tj, res;
    if(k==0){
        res=-inf;
        rep(t, 0, 1){
            ti=i+dir[t][0], tj=j+dir[t][1];
            if(!inside(ti, tj)) continue;
            res=max(res, getf(ti, tj, k^1)+(a[ti][tj]=='-'? -1: 1));
        }
    }
    else{
        res=inf;
        rep(t, 0, 1){
            ti=i+dir[t][0], tj=j+dir[t][1];
            if(!inside(ti, tj)) continue;
            res=min(res, getf(ti, tj, k^1)+(a[ti][tj]=='-'? 1: -1));
        }
    }
    // f[i][j][k]=res;
    // printf("f[%d, %d, %d] == %d\n", i, j, k, f[i][j][k]);
    return f[i][j][k]=res;
}

signed main(){
    n=readin(1), m=readin(1);
    rep(i, 1, n) scanf("%s", a[i]+1);
    rep(i, 1, n) rep(j, 1, m)
        f[i][j][0]=f[i][j][1]=inf;
    int res=getf(1, 1, 0);
    if(res<0) printf("Aoki\n");
    else if(res>0) printf("Takahashi\n");
    else printf("Draw\n");
    return 0;
}