#include<bits/stdc++.h>
using namespace std;
const int N=1e5;
vector<int>v[N];

int main() 
{
   int n;
   cin>>n;
   string s;
   cin>>s;
   if(s[0]==s[s.size()-1])
   {
       char x=s[0];
       int o=0;
   for(int i=1; i<s.size()-1; i++)
   {
       if(x!=s[i] && x!=s[i+1])
       {
           o=1;
           break;
       }
   }
   if(o==1)
   {
       cout<<"2"<<endl;
   }
   else
   {
       cout<<"-1"<<endl;
   }
   }
   else
   {
       cout<<1<<endl;
   }
}

/*########################################################################
# File Name: d.cpp
# Author: SoMnus_L
# Mail: lr599909928@gmail.com
# Created Time:六  5/15 22:12:23 2021
########################################################################*/
#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define pb push_back
#define me memset
#define rep(a,b,c) for(int a=b;a<=c;++a)
#define per(a,b,c) for(int a=b;a>=c;--a)
const int N = 1e6 + 10;
const int mod = 1e9 + 7;
const int INF = 0x3f3f3f3f;
using namespace std;
typedef pair<int,int> PII;
typedef pair<ll,ll> PLL;
ll gcd(ll a,ll b) {return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b) {return a/gcd(a,b)*b;}

int n,m;
string s[N];
int dp[2005][2005];

int main() {
    ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	cin>>n>>m;
	me(dp,-INF,sizeof(dp));
	rep(i,0,n-1){
		cin>>s[i];
	}

	dp[n-1][m-1]=0;
	per(i,n-1,0){
		per(j,m-1,0){
			if(i+1<n){
				if(s[i+1][j]=='+') dp[i][j]=max(dp[i][j],1-dp[i+1][j]);
				else dp[i][j]=max(dp[i][j],-1-dp[i+1][j]);
			}
			if(j+1<m){
				if(s[i][j+1]=='+') dp[i][j]=max(dp[i][j],1-dp[i][j+1]);
				else dp[i][j]=max(dp[i][j],-1-dp[i][j+1]);
			}
		}
	}

	if(dp[0][0]==0) cout<<"Draw\n";
	else if(dp[0][0]>=1) cout<<"Takahashi\n";
	else cout<<"Aoki\n";


    return 0;
}
