#include <bits/stdc++.h>
using namespace std;
string s1, s2;
int a1 = 0, a2 = 0;
int main() {
  cin >> s1 >> s2;
  for (int i = 0; i < s1.size(); i += 2) {
    if (s1[i] == s2[i]) continue;
    if ((s1[i] == '(' && s2[i] == '8') || (s1[i] == '8' && s2[i] == '[') ||
        (s1[i] == '[' && s2[i] == '('))
      a1++;
    else
      a2++;
  }
  if (a1 > a2)
    printf("TEAM 1 WINS");
  else if (a1 < a2)
    printf("TEAM 2 WINS");
  else
    printf("TIE");
  return 0;
}
