#include <stdio.h>
#include<string.h>


int main()
{
   char game[4][2][20]={
    {"elephant", "tiger"},
    {"tiger", "cat"},
    {"cat", "mouse"},
    {"mouse", "elephant"}
   };
   char a[20]={0};
   char b[20]={20};
   scanf("%s %s",a,b);
   for(int i=0;i<4;i++)
   {
     if(strcmp(a,game[i][0])==0&&strcmp(b,game[i][1])==0)
     {
        printf("win");
       return 0;
     }
   }
      for(int i=0;i<4;i++)
   {
     if(strcmp(b,game[i][0])==0&&strcmp(a,game[i][1])==0)
     {
        printf("lose");
       return 0;
     }
   }
   printf("tie");
}