#include <iostream>
using namespace std;
int f(string x){
if(x=="elephant")return 4;
if(x=="tiger")return 3;
if(x=="cat")return 2;
if(x=="mouse")return 1;
else return 0;
}
int vs(int x1,int x2){
if(x1==x2+1 || x1==x2-3)return 1;
if(x1==x2-1 || x2==x1-3)return -1;
else return 0;
}
int main() {
string s1,s2;
cin>>s1>>s2;
int a;
if(vs(f(s1),f(s2))==1)cout<<"win"<<endl;
if(vs(f(s1),f(s2))==0)cout<<"tie"<<endl;
if(vs(f(s1),f(s2))==-1)cout<<"lose"<<endl;
return 0;
}
// 64 位输出请用 printf("%lld")

京公网安备 11010502036488号