#include #include using namespace std; using namespace atcoder; #define rep(i, n) REP(i, 0, n) #define REP(i, s, e) for (ll i = (s); i < (ll)(e); i++) #define repr(i, n) REPR(i, n, 0) #define REPR(i, s, e) for (ll i = (ll)(s - 1); i >= (ll)(e); i--) #define all(r) r.begin(), r.end() #define rall(r) r.rbegin(), r.rend() typedef long long ll; typedef vector vi; typedef vector vl; template bool chmax(T& a, const U& b) { if (a >= b) return false; a = b; return true; } template bool chmin(T& a, const U& b) { if (a <= b) return false; a = b; return true; } void yes_no(bool f, string yes = "Yes", string no = "No") { cout << (f ? yes : no) << "\n"; } void solve() { const int n = 4; using A = array; array v; rep(i, n) cin >> v[i]; ll sum = accumulate(all(v), 0); using P = pair; map mp; const int win = 1, lose = 0, draw = 2; auto dfs = [&](auto self, A deck, int x) -> int { if (mp.count({deck, x})) return mp[{deck, x}]; int y = sum - (accumulate(all(deck), 0) + x); if (deck == A{0, 0, 0, 0}) { return mp[{deck, x}] = x > y ? win : (x == y ? draw : lose); } int f = 0; rep(i, deck.size()) if (deck[i] > 0) { REP(j, 1, min(deck[i], 3) + 1) { deck[i] -= j; int a = x + j, b = y; if (deck[i] == 0) { a += (b + 1) / 2; b /= 2; } auto tmp = self(self, deck, b); if (tmp == lose) { f |= win; } else if (tmp == draw) { f |= draw; } deck[i] += j; } } int ret = lose; if (f & win) ret = win; else if (f & draw) ret = draw; return mp[{deck, x}] = ret; }; int ans = dfs(dfs, v, 0); if (ans == win) cout << "Taro" << '\n'; else if (ans == lose) cout << "Jiro" << '\n'; else if (ans == draw) cout << "Draw" << '\n'; } int main() { cin.tie(0); ios::sync_with_stdio(false); int t = 1; // cin >> t; rep(ti, t) solve(); return 0; }