#include <bits/stdc++.h>

using namespace std;
#define rep(i,n) for (int i =0;i<(n);++i)
using ll = long long;
using P = pair<int, int>;
int   A[2000][2000];
int score[2000][2000];
int H,W;
const int INF = 1001001001;
int calc(int i,int j,int t){
    if(i==H-1&&j==W-1)return 0;
    else if(score[i][j]!=INF)return score[i][j];
    else if (i==H-1){
        if(t==1){
            score[i][j]=calc(i,j+1,0)+ A[i][j+1];
            return score[i][j];}
        else  score[i][j]=calc(i,j+1,1)- A[i][j+1];
        return score[i][j];}
    else if (j==W-1){
        if(t==1)score[i][j]=calc(i+1,j,0)+ A[i+1][j];
        else score[i][j]=calc(i+1,j,1)- A[i+1][j];
        return score[i][j];}
    else {
        if(t==1)score[i][j]=max(calc(i+1,j,0)+ A[i+1][j],calc(i,j+1,0)+ A[i][j+1]);
        else score[i][j]=min(calc(i+1,j,1)- A[i+1][j],calc(i,j+1,1)- A[i][j+1]);
        return score[i][j];
        
        }

}
int main() {
     cin >>H>>W;
    A[2000][2000];
    rep(i,H){
        string tmp;
        cin>> tmp;
        rep(j,W){
        if(tmp[j]=='+')A[i][j]=1;
        else A[i][j]=-1;
        score[i][j]=INF;}
    }
    int ans=calc(0,0,1);
    if(ans>0)cout <<"Takahashi";
    if(ans<0)cout <<"Aoki";
    if(ans==0)cout <<"Draw";
  return 0;
    }
 
#include <iostream>
#include <algorithm>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = unsigned;
using u64 = unsigned long long;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

template <u32 M>
struct modint {
    u32 val;
public:
    static modint raw(int v) { modint x; x.val = v; return x; }
    modint() : val(0) {}
    template <class T>
    modint(T v) { ll x = (ll)(v%(ll)(M)); if (x < 0) x += M; val = u32(x); }
    modint(bool v) { val = ((unsigned int)(v) % M); }
    modint& operator++() { val++; if (val == M) val = 0; return *this; }
    modint& operator--() { if (val == 0) val = M; val--; return *this; }
    modint operator++(int) { modint result = *this; ++*this; return result; }
    modint operator--(int) { modint result = *this; --*this; return result; }
    modint& operator+=(const modint& b) { val += b.val; if (val >= M) val -= M; return *this; }
    modint& operator-=(const modint& b) { val -= b.val; if (val >= M) val += M; return *this; }
    modint& operator*=(const modint& b) { u64 z = val; z *= b.val; val = (u32)(z % M); return *this; }
    modint& operator/=(const modint& b) { return *this = *this * b.inv(); }
    modint operator+() const { return *this; }
    modint operator-() const { return modint() - *this; }
    modint pow(long long n) const { modint x = *this, r = 1; while (n) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
    modint inv() const { return pow(M-2); }
    friend modint operator+(const modint& a, const modint& b) { return modint(a) += b; }
    friend modint operator-(const modint& a, const modint& b) { return modint(a) -= b; }
    friend modint operator*(const modint& a, const modint& b) { return modint(a) *= b; }
    friend modint operator/(const modint& a, const modint& b) { return modint(a) /= b; }
    friend bool operator==(const modint& a, const modint& b) { return a.val == b.val; }
    friend bool operator!=(const modint& a, const modint& b) { return a.val != b.val; }
};
using mint = modint<MOD>;

void solve(){
    int n, a, b;
    cin >> n >> a >> b;
    mint k = max(n-a-b+1, 0);
    mint ans = mint(max(0, n-b+1))*mint(max(0, n-a+1))*k*(k+1)*2-k*(k+1)*k*(k+1);
    cout << ans.val << "\n";
}

int main() {
    int t;
    cin >> t;
    while(t--){
        solve();
    }
    return 0;
}