Problem: Two teams meet in The Game World Championship. Some scientists consider this game to be the most intellectually challenging game in the world. You are given two strings describing the teams' actions in the final battle. Figure out who became the champion.

Input

The input contains two strings of equal length (between 2 and 20 characters, inclusive). Each line describes the actions of one team.

Output

Output "TEAM 1 WINS" if the first team won, "TEAM 2 WINS" if the second team won, and "TIE" if there was a tie.

Examples

Input

[]()[]8&lt;
8&lt;[]()8&lt;


Output

TEAM 2 WINS


Input

8&lt;8&lt;()
[]8&lt;[]


Output

TIE

Solution (in PYTHON):

Solution:
import re
# import numpy as np

team_one = raw_input()
team_two = raw_input()

def get_action_list(team):
	team = team.replace("[]",str(0)).replace("()",str(1)).replace("8<",str(2))
	team = re.findall('.', team)
	return team
	
team_one_action = get_action_list(team_one)
team_two_action = get_action_list(team_two)

# print team_one_action
# print team_two_action

def calculate_point(team_one, team_two):
	# score = np.zeros(2)
	score = [0, 0]
	for i in range(len(team_one)):
		team_one_action = int(team_one[i])
		team_two_action = int(team_two[i])
		if (team_one_action - team_two_action) % 3 == 2:
			score[0] += 1
		elif (team_one_action - team_two_action) % 3 == 1:
			score[1] += 1
	return score
		
points = calculate_point(team_one_action, team_two_action)

# print points

if points[1] > points[0]:
	print "TEAM 2 WINS"
elif points[1] < points[0]:
	print "TEAM 1 WINS"
else:
	print "TIE"