include <bits/stdc++.h>
using namespace std;
int main() {
int T;
int alice;
int bob;
int a[6];
int b[6];
scanf("%d", &T);
while (T--) {
alice = 0;
bob = 0;
for (int i = 0; i < 6; i++) { scanf("%d", &a[i]); } for (int i = 0; i < 6; i++) { scanf("%d", &b[i]); } for (int i = 0; i < 6; i++) { for (int j = 0; j < 6; j++) { if (a[i] > b[j]) { alice++; } else if (b[j] > a[i]) { bob++; } } } if (alice > bob) { printf("Alice\n"); } else if (bob > alice) { printf("Bob\n"); } else { printf("Tie\n"); }
}
return 0;
}