#include <bits/stdc++.h>
using namespace std;
int main() {
  char s[33] = {0};
  char s1[33] = {0};
  scanf("%s%s", s, s1);
  int len = strlen(s);
  int win1 = 0;
  int win2 = 0;
  for (int i = 0; i < len; i += 2) {
    if (s[i] == s1[i]) continue;
    if (s[i] == '8' && s1[i] == '[' || s[i] == '[' && s1[i] == '(' ||
        s[i] == '(' && s1[i] == '8')
      win1++;
    else
      win2++;
  }
  if (win1 == win2)
    puts("TIE");
  else if (win1 > win2)
    puts("TEAM 1 WINS");
  else
    puts("TEAM 2 WINS");
}
