#include <bits/stdc++.h>
char a[100], b[100];
int ans1, ans2;
int main() {
  scanf("%s%s", a, b);
  for (int i = 0; i < 100; i += 2) {
    if (a[i] == '8' && b[i] == '(') ans2++;
    if (a[i] == '8' && b[i] == '[') ans1++;
    if (a[i] == '(' && b[i] == '8') ans1++;
    if (a[i] == '(' && b[i] == '[') ans2++;
    if (a[i] == '[' && b[i] == '8') ans2++;
    if (a[i] == '[' && b[i] == '(') ans1++;
  }
  if (ans1 > ans2) puts("TEAM 1 WINS");
  if (ans1 < ans2) puts("TEAM 2 WINS");
  if (ans1 == ans2) puts("TIE");
}
