#include #include using namespace std; int a, b; bool mem[128][128]; bool res[128][128]; bool play1(int a, int b) { if (a == 1 && b == 1) { return 0; } for (int i = 1; i < a; i++) { if (!play1(i, a - i)) { return 1; } } for (int i = 1; i < b; i++) { if (!play1(i, b - i)) { return 1; } } return 0; } bool play2(int a, int b) { if (a == 1 && b == 1) { return 0; } if (mem[a][b]) { return res[a][b]; } mem[a][b] = true; for (int i = 1; i < a; i++) { if (!play2(i, a - i)) { return res[a][b] = 1; } } for (int i = 1; i < b; i++) { if (!play2(i, b - i)) { return res[a][b] = 1; } } return res[a][b] = 0; } void subtask1() { if (play1(a, b)) { cout << "Tuzik\n"; } else { cout << "Vanka\n"; } } void subtask2() { if (play2(a, b)) { cout << "Tuzik\n"; } else { cout << "Vanka\n"; } } int main() { //freopen("input.txt", "r", stdin); int t; cin >> t; while (t--) { cin >> a >> b; if (a <= 10 && b <= 10) { subtask1(); } else if (a <= 100 && b <= 100) { subtask2(); } else { if (a % 2 == 1 && b % 2 == 1) { cout << "Vanka\n"; } else { cout << "Tuzik\n"; } } } return 0; }