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.
The input contains two strings of equal length (between 2 and 20 characters, inclusive). Each line describes the actions of one team.
from sys import stdin,stdout
# from bisect import bisect_left,bisect
# from heapq import heapify,heappop,heappush
# from sys import setrecursionlimit
# from collections import defaultdict,Counter
# from itertools import permutations
# from math import gcd,ceil,sqrt,factorial
# setrecursionlimit(int(1e5))
input,print = stdin.readline,stdout.write

s = input().strip()
t = input().strip()
n = len(s)
x = 0
y = 0
for i in range(0,n,2):
    a = s[i:i+2]
    b = t[i:i+2]
    if a=="[]":
        if b=="()":
            x+=1
        elif b=="8<":
            y+=1
    elif a=="()":
        if b=="[]":
            y+=1
        elif b=="8<":
            x+=1
    elif a=="8<":
        if b=="[]":
            x+=1
        elif b=="()":
            y+=1
if x>y:
    ans = "TEAM 1 WINS"
elif x<y:
    ans = "TEAM 2 WINS"
else:
    ans = "TIE"
print(ans+"\n")
