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