#include<bits/stdc++.h>
using namespace std;
int main(){
int n,a = 0,b = 0,i,x,y;
cin>>n;
for(i = 0;i < n;i++){
cin>>x>>y;
if(x == 1 && y == 2 || x == 2 && y == 3 || x == 3 && y == 1){
a++;
}else if(x != y){
b++;
}
}
if(a > b){
cout<<"a win"<<endl;
}else if(a < b){
cout<<"b win"<<endl;
}else{
cout<<"tie"<<endl;
}
return 0;
}
/**************************************************************
Problem: 1406
User: zhuanghaoxiang
Language: C++
Result: Accepted
Time:18 ms
Memory:2072 kb
****************************************************************/