#include <bits/stdc++.h>

int nextInt() {
    int temp; scanf("%d", &temp);
    return temp;
}
long long nextLL() {
    long long temp; scanf("%lld", &temp);
    return temp;
}

void print(int x, char endc = '\n') {
    printf("%d%c", x, endc);
    return;
}
void print(long long x, char endc = '\n') {
    printf("%lld%c", x, endc);
    return;
}
void print(size_t x, char endc = '\n') {
    printf("%zu%c", x, endc);
    return;
}
void print(float x, char endc = '\n') {
    printf("%f%c", x, endc);
    return;
}
void print(double x, char endc = '\n') {
    printf("%lf%c", x, endc);
    return;
}

template<typename T1, typename T2>
void print(std::pair<T1, T2> &p, char sepc = ' ', char endc = '\n') {
    print(p.first, sepc);
    print(p.second, endc);
    return;
}

template<typename T>
void print(std::vector<T> &v, char sepc = ' ', char endc = '\n') {
    for(T e : v) print(e, sepc);
    printf("%c", endc);
    return;
}





using namespace std;


const int MAX_V = 2000;
const long long int INF = 96543219987654321;

int V; 
vector<pair<int, long long> > adj[MAX_V];

void pushAllAdj(int here, vector<long long> &dist, long long cost, priority_queue<pair<long long, int>> &pq) {
    for(int i = 0; i < adj[here].size(); ++i) {
        int there = adj[here][i].first;
        int nextDist = cost + adj[here][i].second;
        if(dist[there] > nextDist) {
            dist[there] = nextDist;
            pq.push(make_pair(-nextDist, there));
        }
    }
}

vector<long long> dijkstra(int src) {
	vector<long long> dist(V, INF);
	priority_queue<pair<long long, int> > pq;
    pushAllAdj(src, dist, 0, pq);
	while(!pq.empty()) {
		long long cost = -pq.top().first;
		int here = pq.top().second;
		pq.pop();
		if(dist[here] < cost) continue;
        pushAllAdj(here, dist, cost, pq);
	}
	return dist;
}


int main() {
    int N = nextInt(), M = nextInt();
    V = N;
    
    for(int i = 0; i < M; i++) {
        int A = nextInt(), B = nextInt(), C = nextInt();
        adj[A-1].push_back(make_pair(B-1, C));
    }

    for(int i = 0; i < N; i++) {
        auto res = dijkstra(i)[i];
        print(res == INF ? -1LL : res);
    }
}
#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using ld = long double;

#define rep(i, a, b) for (auto i = (a); i < (b); ++i)
#define per(i, a, b) for (auto i = (b); i-- > (a); )
#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) int((x).size())
#define lb(x...) lower_bound(x)
#define ub(x...) upper_bound(x)

template<class T> bool ckmin(T& a, const T& b) { return a > b ? a = b, 1 : 0; }
template<class T> bool ckmax(T& a, const T& b) { return a < b ? a = b, 1 : 0; }

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

const int N = 1 << 11, inf = 1e9;
int dp[N][N], a[N][N];

void verdict(int x) {
	if (x == 0) cout << "Draw\n";
	else cout << (x > 0 ? "Takahashi" : "Aoki") << '\n';
	exit(0);
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(nullptr);

	int n, m; cin >> n >> m;

	auto f = [&](int i, int j) {
		return (i ^ j) & 1;
	};

	rep(i, 0, n) rep(j, 0, m) {
		char c; cin >> c;
		a[i][j] = c == '+' ? +1 : -1;
		dp[i][j] = f(i, j) ? inf : -inf;		
	}

	dp[n - 1][m - 1] = 0;
	per(i, 0, n) {
		per(j, 0, m) {
			if (f(i, j)) {
				int nxt = dp[i][j] + a[i][j];
				if (i > 0) ckmax(dp[i - 1][j], nxt);
				if (j > 0) ckmax(dp[i][j - 1], nxt);
			} else {
				int nxt = dp[i][j] - a[i][j];
				if (i > 0) ckmin(dp[i - 1][j], nxt);
				if (j > 0) ckmin(dp[i][j - 1], nxt);
			}
		}
	}

	verdict(dp[0][0]);
}