#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef long double ld;
typedef pair<int, int> Pii;
typedef pair<int, ll> Pil;
typedef pair<ll, ll> Pll;
typedef pair<ll, int> Pli;
typedef vector < vector<ll> > Mat;
#define fi first
#define se second
const ll MOD = 1e9 + 7;
const ll MOD2 = 998244353;
const ll MOD3 = 1812447359;
const ll INF = 1ll << 62;
const double PI = 2 * asin(1);
void yes() {printf("yes\n");}
void no() {printf("no\n");}
void Yes() {printf("Yes\n");}
void No() {printf("No\n");}
void YES() {printf("YES\n");}
void NO() {printf("NO\n");}

ll Pow(ll A, ll N){
  if (N == 0) return 1;
  if (N % 2 == 0) return Pow(A * A % MOD, N / 2);
  else return Pow(A * A % MOD, N / 2) * A % MOD;
}

int H, W;
ll K;
char S[2005][2005];
ll cnt[2005][2005], ans[2005][2005];


int main(){
  cin >> H >> W;
  for (int i = 1; i <= H; i++){
    for (int j = 1; j <= W; j++){
      cin >> S[i][j];
      if (S[i][j] == '.') K++;
    }
  }

  for (int i = 1; i <= H; i++){
    queue <int> que;
    int now = 0;
    for (int j = 1; j <= W + 1; j++){
      if (S[i][j] == '.') {
        now++; que.push(j);
      }
      else{
        while (!que.empty()){
          cnt[i][que.front()] += now;
          que.pop();
        }
        now = 0;
      }
    }
  }
  for (int j = 1; j <= W; j++){
    queue <int> que;
    int now = 0;
    for (int i = 1; i <= H + 1; i++){
      if (S[i][j] == '.') {
        now++; que.push(i);
      }
      else{
        while (!que.empty()){
          cnt[que.front()][j] += now - 1;
          que.pop();
        }
        now = 0;
      }
    }
  }

  for (int i = 1; i <= H; i++){
    for (int j = 1; j <= W; j++){
      if (S[i][j] != '.') continue;
      ans[i][j] = Pow(2, K) - Pow(2, K - cnt[i][j]);
      ans[i][j] %= MOD;
      if (ans[i][j] < 0) ans[i][j] += MOD;
    }
  }

  ll res = 0;
  for (int i = 1; i <= H; i++){
    for (int j = 1; j <= W; j++){
      res += ans[i][j];
      res %= MOD;
    }
  }
  cout << res << endl;

  return 0;
}
#include <iostream>
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <set>
#include <queue>
#include <map>
 
using namespace std;
typedef long long int ll;
typedef pair <int,int> pii;
typedef pair<ll,ll> pll;
 
 
/*bool compare_function(const pair<int, int> a, const pair<int, int> b)
{
    return a.first < b.first;
}*/
// use case
//sort(V.begin(), V.end(), compare_function);
 
/*struct compare
{
    bool operator ()(const pair<int, int> &a, const pair<int, int> &b) {
    if (a.second-a.first==b.second-b.first)
    {
        return a.first>b.first;
    }
    return a.second-a.first < b.second-b.first;}
};
priority_queue <pair<int,int>, vector <pair<int,int>>, compare> Q;*/
 
/*void print1(vector <int> X)
{
    for (int i=0; i<X.size(); i++)
    {
        cout<<X[i]<<" ";
    }
    cout<<endl;
    return;
}
 
void print2(vector <vector <int>> X)
{
    for (int i=0; i<X.size(); i++)
    {
    for (int j=0;j<X[i].size();j++) {
        cout<<X[i][j]<<" ";}
    cout<<endl;}
    return;
}*/

void update(vector <vector <int>> &A, vector <vector <pii>> &B, int r, int c, int h, int w) {
	//cout<<r<<" "<<c<<" "<<h<<" "<<w<<endl;
	if (r==h-1) {
		B[r][c].first=B[r][c+1].second+A[r][c+1];
		B[r][c].second=B[r][c+1].first;
		//cout<<B[r][c].first<<endl;
		return;
		}
	if (c==w-1) {
		B[r][c].first=B[r+1][c].second+A[r+1][c];
		B[r][c].second=B[r+1][c].first;
		return;
		}
	int a=B[r+1][c].second+A[r+1][c]-B[r+1][c].first;
	int b=B[r][c+1].second+A[r][c+1]-B[r][c+1].first;
	if (a>b) {
		B[r][c].first=B[r+1][c].second+A[r+1][c];
		B[r][c].second=B[r+1][c].first;
		return;
		}
	B[r][c].first=B[r][c+1].second+A[r][c+1];
	B[r][c].second=B[r][c+1].first;
	return;
	}
 
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int h,w;
    cin>>h>>w;
    vector <string> X(h);
    for (int i=0;i<h;i++) {cin>>X[i];}
    vector <vector <int>> A(h,vector <int>(w,1));
    for (int i=0;i<h;i++) {
		for (int j=0;j<w;j++) {
			if (X[i][j]=='-') {A[i][j]=-1;}
			//cout<<i<<" "<<j<<" "<<A[i][j]<<endl;
			}
		}
    vector <vector <pii>> B(h,vector <pii>(w,{0,0}));
    for (int r=h-1;r>=0;r--) {
		for (int c=w-1;c>=0;c--) {
			if (r<h-1 || c<w-1) {update(A,B,r,c,h,w);}
			//cout<<r<<" "<<c<<" "<<B[r][c].first<<" "<<B[r][c].second<<endl;
			}
		}
	int a=B[0][0].first-B[0][0].second;
	if (a>0) {cout<<"Takahashi"<<endl;}
	if (a==0) {cout<<"Draw"<<endl;}
	if (a<0) {cout<<"Aoki"<<endl;}
    return 0;
}
