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