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:
# -*- coding: utf-8 -*-

import sys

t1 = raw_input()
t2 = raw_input()

s1 = 0
s2 = 0

def f(a, b):
    if a == '8<':
        if b == '[]':
            return 1
        return 0
    if a == '[]':
        if b == '()':
            return 1
        return 0
    if a == '()':
        if b == '8<':
            return 1
        return 0

r = ['8<', '[]', '()']

for i in xrange(0, len(t1), 2):
    a = t1[i] + t1[i+1]
    b = t2[i] + t2[i+1]
    if (not a in r) and (not b in r):
        print 'TIE'
        sys.exit(0)
    if (not a in r):
        print 'TEAM 2 WINS'
        sys.exit(0)
    if (not b in r):
        print 'TEAM 1 WINS'
        sys.exit(0)
    if a == b:
        pass
    elif f(a,b):
        s1 += 1
    else:
        s2 += 1

if s1 < s2:
    print 'TEAM 2 WINS'
elif s1 == s2:
    print 'TIE'
else:
    print 'TEAM 1 WINS'