#include<bits/stdc++.h>
#define ll long long
using namespace std;
const int mod=1e9+7;
const int N=1e5+10;
int  a[3000][3000];
struct node
{
    int ta,ao;
    int id;
} b[3000][3000];
int main()
{
    int h,w;
    cin>>h>>w;
    char c;
    for(int i=1; i<=h; i++)
    {
        for(int j=1; j<=w; j++)
        {
            cin>>c;
            if(c=='+')
            {
                a[i][j]=1;
            }
            else
                a[i][j]=-1;
        }
    }
    for(int i=h; i>=1; i--)
    {
        for(int j=w; j>=1; j--)
        {
            if(i==h&&j==w)
            {
                b[i][j].id=(i+j)%2;
                continue;
            }
            if(i==h)
            {
                b[i][j].id=(b[i][j+1].id+1)%2;
                if(b[i][j].id%2==0)
                {

                    b[i][j].ta=b[i][j+1].ta+a[i][j+1];
                    b[i][j].ao=b[i][j+1].ao;
                }
                else
                {

                    b[i][j].ao=b[i][j+1].ao+a[i][j+1];
                    b[i][j].ta=b[i][j+1].ta;
                }
            }
            else if(j==w)
            {
                b[i][j].id=(b[i+1][j].id+1)%2;
                if(b[i][j].id%2==0)
                {

                    b[i][j].ta=b[i+1][j].ta+a[i+1][j];
                    b[i][j].ao=b[i+1][j].ao;
                }
                else
                {
                    b[i][j].ao=b[i+1][j].ao+a[i+1][j];
                    b[i][j].ta=b[i+1][j].ta;
                }
            }
            else
            {
                b[i][j].id=(b[i][j+1].id+1)%2;
                if(b[i][j].id%2==0)
                {

                    if(b[i+1][j].ta+a[i+1][j]-b[i+1][j].ao>b[i][j+1].ta+a[i][j+1]-b[i][j+1].ao)
                    {

                        b[i][j].ta=b[i+1][j].ta+a[i+1][j];
                        b[i][j].ao=b[i+1][j].ao;
                    }
                    else
                    {
                        b[i][j].ta=b[i][j+1].ta+a[i][j+1];
                        b[i][j].ao=b[i][j+1].ao;
                    }
                }
                else
                {
                    if(b[i+1][j].ao+a[i+1][j]-b[i+1][j].ta>b[i][j+1].ao+a[i][j+1]-b[i][j+1].ta)
                    {

                        b[i][j].ao=b[i+1][j].ao+a[i+1][j];
                        b[i][j].ta=b[i+1][j].ta;
                    }
                    else
                    {
                        b[i][j].ao=b[i][j+1].ao+a[i][j+1];
                        b[i][j].ta=b[i][j+1].ta;
                    }
                }
            }
        }
    }
    if(b[1][1].ao>b[1][1].ta)
    {
        cout<<"Aoki"<<endl;
    }
    else if(b[1][1].ao<b[1][1].ta)
    {
        cout<<"Takahashi"<<endl;
    }
    else
    {
        cout<<"Draw"<<endl;
    }
    return 0;
}

#include <bits/stdc++.h>
#define rep(i,n) for (ll i = 0; i < (ll)(n); i++)
#define repr(i,a,b) for (ll i = (a); i < (ll)(b); i++)
#define rng(x) (x).begin(), (x).end()
#define rrng(x) (x).rbegin(), (x).rend()
#define popcnt(x) __builtin_popcountll(x)
#define pb push_back
#define eb emplace_back
#define MP make_pair
#define MT make_tuple
#define fr first
#define sc second

using namespace std;
template <class T, class U> inline bool chmax(T &a, const U &b) { return (a < b ? a = b, 1 : 0); }
template <class T, class U> inline bool chmin(T &a, const U &b) { return (a > b ? a = b, 1 : 0); }
template <class T> using vc = vector<T>;
template <class T> using vv = vc<vc<T>>;
template <class T> using vvv = vc<vv<T>>;
template <class T> using PQ = priority_queue<T, vc<T>, greater<T>>;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using pdd = pair<ld, ld>;
using ti3 = tuple<int, int, int>;
using tl3 = tuple<ll, ll, ll>;
using vi = vc<int>;
using vl = vc<ll>;
using vs = vc<string>;
using vpl = vc<pll>;
using vpd = vc<pdd>;
using vvi = vv<int>;
using vvl = vv<ll>;
using vvpl = vv<pll>;

const ld pi = 3.141592653589793;
const ll linf = 1001001001001001001LL;
const int inf = 1001001001;

constexpr int MOD = 1e9+7;
// constexpr int MOD = 998244353;

struct mint {
long long x;
  mint(long long x = 0) noexcept : x((x%MOD + MOD) % MOD) {}

  // basis
  mint operator-() const { return mint(-x); }
  mint& operator+=(const mint a) noexcept { if((x += a.x) >= MOD) x -= MOD; return *this; }
  mint& operator-=(const mint a) noexcept { if((x += MOD-a.x) >= MOD) x -= MOD; return *this; }
  mint& operator*=(const mint a) noexcept { (x *= a.x) %= MOD; return *this; }
  mint operator+(const mint a) const noexcept { return mint(*this) += a; }
  mint operator-(const mint a) const noexcept { return mint(*this) -= a; }
  mint operator*(const mint a) const noexcept { return mint(*this) *= a; }
  mint mpow(long long t) const noexcept {
    if(!t) return 1;
    mint a = mpow(t>>1);
    a *= a;
    if(t&1) a *= *this;
    return a;
  }

  // for prime MOD
  mint inv() const noexcept { return mpow(MOD-2); }
  mint& operator/=(const mint a) noexcept { return *this *= a.inv(); }
  mint operator/(const mint a) const noexcept { return mint(*this) /= a; }

  // comparison
  bool operator==(const mint &a) const noexcept { return this->x == a.x; }
  bool operator!=(const mint &a) const noexcept { return this->x != a.x; }

  // I/O stream
  friend istream& operator>>(istream& is, mint& a) noexcept { return is >> a.x; }
  friend ostream& operator<<(ostream& os, const mint& a) noexcept { return os << a.x; }
};
// additional
mint mpow(const long long &a, long long n) noexcept { return mint(a).mpow(n); }
mint mpow(const mint &a, long long n) noexcept { return a.mpow(n); }

int main() {
  ll h, w;
  cin >> h >> w;
  vs S(h);
  rep(i,h) cin >> S[i];
  vvl R(h, vl(w, 0)), C(h, vl(w, 0));
  rep(i,h) {
    ll l = 0, r = 0;
    while (l < w) {
      while (r < w && S[i][r] == '.') r++;
      repr(j,l,r) R[i][j] = r-l;
      if (l == r) r++;
      l = r;
    }
  }
  rep(i,w) {
    ll l = 0, r = 0;
    while (l < h) {
      while (r < h && S[r][i] == '.') r++;
      repr(j,l,r) C[j][i] = r-l;
      if (l == r) r++;
      l = r;
    }
  }
  ll K = 0;
  rep(i,h)rep(j,w) K += S[i][j] == '.';
  mint ans = 0;
  rep(i,h)rep(j,w) {
    if (S[i][j] == '#') continue;
    ans += mpow(2, K-(R[i][j]+C[i][j]-1))*(mpow(2, R[i][j]+C[i][j]-1)-1);
  }
  cout << ans << endl;
}