#include <stdio.h>
//noob54 斗兽棋
int judge(char x) {
	if (x == 'e')//大象
		return 3;
	else if (x == 't')//老虎
		return 2;
	else if (x == 'c')//猫
		return 1;
	else//老鼠
		return 0;
    
}

int main() {
	char s1[10] = { 0 }, s2[10] = {0};
	int a = 0, b = 0, c = 0;
	scanf("%s%s", s1, s2);
	a = judge(s1[0]);//牛牛
	b = judge(s2[0]);//牛妹
	c = a - b;//c=1或-3牛牛赢,c=-1或3牛妹赢,其他平局
	if (c == 1 || c == -3)
		printf("win");
	else if (c == -1 || c == 3)
		printf("lose");
	else
		printf("tie");
	return 0;
}