#include #include #include #include #include #include #define repeat(i,n) for (int i = 0; (i) < (n); ++(i)) #define repeat_from(i,m,n) for (int i = (m); (i) < (n); ++(i)) #define whole(f,x,...) ([&](decltype((x)) y) { return (f)(begin(y), end(y), ## __VA_ARGS__); })(x) using namespace std; template void setmax(T & a, T const & b) { if (a < b) a = b; } const int win = 1; const int draw = 0; const int lose = -1; int solve(array n, int a, int b) { if (b < a) return - solve(n, b, a); whole(sort, n); static map, int, int>, int> memo; auto key = make_tuple(n, a, b); if (memo.count(key)) return memo[key]; int result = -2; repeat (i,4) { repeat_from (d, 1, min(3,n[i])+1) { n[i] -= d; int c = n[i] ? 0 : (b+1)/2; setmax(result, solve(n, a+d+c, b-c)); n[i] += d; } } if (result == -2) { result = a > b ? win : a < b ? lose : draw; } return memo[key] = result; } int main() { array n; cin >> n[0] >> n[1] >> n[2] >> n[3]; int ans = solve(n, 0, 0); cout << (ans == win ? "Taro" : ans == lose ? "Jiro" : "Draw") << endl; return 0; }