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 sys

inp = sys.stdin.read().strip().splitlines()

t1 = inp[0][::2]
t2 = inp[1][::2]

w1 = 0
w2 = 0

for T1, T2 in zip(t1, t2):
    s = '%s%s' % (T1, T2)
    if   s in ['[(', '(8', '8[']:
        w1 += 1
    elif s in ['([', '8(', '[8']:
        w2 += 1

if w1 > w2:
    res = "TEAM 1 WINS"
elif w1 < w2:
    res = "TEAM 2 WINS"
else:
    res = "TIE"
sys.stdout.write(str(res))