#include <bits/stdc++.h>
using namespace std;
void put(int x) {
  if (x < 0) {
    putchar('-');
    x *= -1;
  }
  if (x == 0) {
    putchar('0');
  }
  int num = 0;
  char c[15];
  while (x) {
    c[++num] = (x % 10) + 48;
    x /= 10;
  }
  while (num) {
    putchar(c[num--]);
  }
  putchar('\n');
}
inline void in(int &x) {
  char ch = getchar();
  int flag = 1;
  while (!(ch >= '0' && ch <= '9')) {
    if (ch == '-') flag *= -1;
    ch = getchar();
  }
  x = ch - '0';
  ch = getchar();
  while (ch >= '0' && ch <= '9') {
    x = ((x << 3) + (x << 1)) + ch - '0';
    ch = getchar();
  }
  x *= flag;
}
string s1, s2;
int sum1, sum2;
int work(char a, char b) {
  if (a == '8' && b == '<') return 1;
  if (a == '(' && b == ')') return 2;
  if (a == '[' && b == ']') return 3;
}
int main() {
  cin >> s1 >> s2;
  for (int i = 0; i < s1.size(); i += 2) {
    int k1 = work(s1[i], s1[i + 1]), k2 = work(s2[i], s2[i + 1]);
    if ((k1 == 1 && k2 == 2) || (k1 == 2 && k2 == 3) || (k1 == 3 && k2 == 1))
      sum2++;
    else if (k1 == k2)
      continue;
    else
      sum1++;
  }
  if (sum1 > sum2) printf("TEAM 1 WINS\n");
  if (sum1 == sum2) printf("TIE\n");
  if (sum1 < sum2) printf("TEAM 2 WINS\n");
  return 0;
}
