#include <bits/stdc++.h>
using namespace std;

typedef long long LL;
const int N = 100010;
int a[N], b[N], c[N], d[N];
int n, l;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cin >> n >> l;
    for (int i = 1; i <= n; i++)
        cin >> a[i];
    for (int i = 1; i <= n; i++)
        cin >> b[i];
    a[n + 1] = l + 1;
    b[n + 1] = l + 1;
    for (int i = 0; i <= n; i++) {
        c[i] = a[i + 1] - a[i] - 1;
        d[i] = b[i + 1] - b[i] - 1;
    }

    LL ans = 0;
    for (int i = 0, j = 0; i <= n; i++) {
        if (d[i]) {
            while (j <= n && c[j] == 0) j++;
            int l = j, s = 0;
            while (j <= n && s < d[i]) 
                s += c[j++];
            if (s != d[i]) {
                puts("-1");
                return 0;
            }
            ans += max(i - l, 0) +  max(j - 1 - i, 0);
        }
    }
    cout << ans << endl;
    return 0;
}

#include <bits/stdc++.h>
using namespace std;
#define eb emplace_back
using ll = long long;
const int inf = 1e9+5;
const ll INF = 1e18+5;
const int nax = 2e5+500;
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	int h, w;
	cin >> h >> w;
	vector<vector<int>> g(h+1, vector<int> (w+1));
	for(int i=1;i<=h;i++) {
		for(int j=1;j<=w;j++) {
			char ch;
			cin >> ch;
			g[i][j] = (ch == '+'?1:-1);
		}
	}
	vector<vector<int>> dp(h+2, vector<int> (w+2));
	for(int i=h;i>=1;--i) {
		for(int j=w;j>=1;--j) {
		if(i == h && j == w) dp[i][j] = 0;
			else if((i + j) % 2 == 0) {
					dp[i][j] = -(1 << 30);
					if(i + 1  <= h) dp[i][j] = max(dp[i][j], dp[i+1][j] + g[i+1][j]);
					if(j + 1 <= w) dp[i][j] = max(dp[i][j], dp[i][j+1] + g[i][j+1]);
			} else {
					dp[i][j] = (1 << 30);
					if(i+1 <= h) dp[i][j] = min(dp[i][j], dp[i+1][j] - g[i+1][j]);
					if(j+1 <= w) dp[i][j] = min(dp[i][j], dp[i][j+1] - g[i][j+1]);
			}
		}
	}
	if((h == 1 && w == 1) || dp[1][1] == 0) cout << "Draw";
	else cout << (dp[1][1] > 0 ? "Takahashi":"Aoki");


	
}
