#include <cstdio>
#include <algorithm>

int A[2001][2001];
int dp[2001][2001];

int main(){
  int h, w;
  scanf("%d%d", &h, &w);
  for(int i = 0; i < h; i++){
    for(int j = 0; j < w; j++){
      char c;
      do { scanf("%c", &c); } while(c != '+' && c != '-');
      A[i][j] = c == '+' ? 1 : -1;
    }
  }

  for(int i = h-1; i >= 0; i--){
    for(int j = w-1; j >= 0; j--){
      if(i == h-1 && j == w-1) continue;
      dp[i][j] = -1000000000;
      if(i < h-1) dp[i][j] = -dp[i+1][j]+A[i+1][j];
      if(j < w-1) dp[i][j] = std::max(dp[i][j], -dp[i][j+1]+A[i][j+1]);
    }
  }

  if(dp[0][0] == 0) puts("Draw");
  else if(dp[0][0] > 0) puts("Takahashi");
  else puts("Aoki");

  return 0;
}
 

#include <bits/stdc++.h>
using namespace std;
typedef long long llo;
#define mp make_pair
#define pb push_back
#define a first 
#define b second
#define endl '\n' 
llo aa[100001];
llo bb[100001];

int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	llo n,l;
	cin>>n>>l;
	llo ans=0;
	for(llo i=0;i<n;i++){
		cin>>aa[i];
	}
	for(llo i=0;i<n;i++){
		cin>>bb[i];
	}
	vector<llo> cc;
	cc.pb(aa[0]-1);
	for(llo i=1;i<n;i++){
		cc.pb(aa[i]-aa[i-1]-1);
	}
	cc.pb(l-aa[n-1]);
	vector<llo> dd;
	dd.pb(bb[0]-1);
	for(llo i=1;i<n;i++){
		dd.pb(bb[i]-bb[i-1]-1);
	}
	dd.pb(l-bb[n-1]);

	llo ind=0;
	/*for(auto j:cc){
		cout<<j<<",";
	}
	cout<<endl;
	for(auto j:dd){
		cout<<j<<",";
	}
	cout<<endl;*/
	for(llo i=0;i<=n;i++){
		if(dd[i]==0){
			continue;
		}
		llo su=0;
		llo l=ind;
		while(su<dd[i] and ind<=n){
			su+=cc[ind];
			ind++;
		}
		llo r=ind-1;

		if(su!=dd[i]){
			cout<<-1<<endl;
			return 0;
		}
		while(l<r){
			if(cc[l]==0){
				l+=1;
			}
			else{
				break;
			}
		}
		while(r>l){
			if(cc[r]==0){
				r-=1;
			}
			else{
				break;
			}
		}
		ind=r+1;
	//	cout<<i<<":"<<l<<":"<<r<<endl;
		ans+=(max(r-i,(llo)0)+max(i-l,(llo)0));
	}



	cout<<ans<<endl;















	return 0;
}