#include using namespace std; int T, tim, ans[200][10][10][10][10], _ans[200][10][10][10][10]; int main() { function dfs = [&](int dep, int a, int b, int c, int d) { if (dep >= 200) return -1; if (!c || !d) { _ans[dep][a][b][c][d] = 1; return ans[dep][a][b][c][d] = 0; } if (_ans[dep][a][b][c][d]) return ans[dep][a][b][c][d]; int v1 = dfs(dep + 1, c, d, (a + c) % 10, b); int v2 = dfs(dep + 1, c, d, (a + d) % 10, b); int v5 = dfs(dep + 1, c, d, (a + b) % 10, b); int v3 = dfs(dep + 1, c, d, a, (b + c) % 10); int v4 = dfs(dep + 1, c, d, a, (b + d) % 10); int v6 = dfs(dep + 1, c, d, a, (b + a) % 10); _ans[dep][a][b][c][d] = 1; if (!v1 || !v2 || !v3 || !v4 || !v5 || !v6) return ans[dep][a][b][c][d] = 1; if (!~v1 || !~v2 || !~v3 || !~v4 || !~v5 || !~v6) return ans[dep][a][b][c][d] = -1; return ans[dep][a][b][c][d] = 0; }; int cnt0 = 0, cnt1 = 0, cnt2 = 0; for (int i = 1; i <= 9; i++) { for (int j = 1; j <= 9; j++) { for (int k = 1; k <= 9; k++) { for (int l = 1; l <= 9; l++) { int v = dfs(0, i, j, k, l); if (v == 1) cnt0++; if (v == 0) cnt1++; if (v == -1) cnt2++; } } } } scanf("%d", &T); while (T--) { int x1, x2, y1, y2; scanf("%d %d %d %d", &x1, &x2, &y1, &y2); int v = dfs(0, x1, x2, y1, y2); if (v == 1) puts("Alice"); else if (!v) puts("Bob"); else puts("Tie"); } return 0; }