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 PYTHON3):

Solution:
__author__ = 'Nova'

# import sys
# sys.stdin = open('input.txt', 'r')


def parse_string(s):
    ret = []
    m = len(s) // 2;
    for i in range(m):
        ss = ''.join(s[i * 2:i * 2 + 2])
        if ss == '8<':
            ret.append(0)
        elif ss == '[]':
            ret.append(1)
        elif ss == '()':
            ret.append(2)
    return ret


s1, s2 = input(), input()
l1, l2 = parse_string(s1), parse_string(s2)
res = 0
mapo = {(0, 1): 1, (1, 2): 1, (2, 0): 1, (1, 0): -1, (2, 1): -1, (0, 2): -1}
for i in range(len(l1)):
    if l1[i] != l2[i]:
        res += mapo[(l1[i], l2[i])]

if res == 0:
    print('TIE')
elif res > 0:
    print('TEAM 1 WINS')
else:
    print('TEAM 2 WINS')