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