#include <iostream>
using namespace std;
int main(){
	//a b代表a和b赢的次数 
	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;
	}
}

/**************************************************************
	Problem: 1406
	User: admin
	Language: C++
	Result: Accepted
	Time:24 ms
	Memory:2072 kb
****************************************************************/