#include <bits/stdc++.h>
using namespace std;
class process {
 private:
  vector<string> args;
  vector<int> path;

 public:
  vector<string> get_args() { return args; }
  void set_args(vector<string> args) { this->args = args; }
  vector<int> get_path() { return path; }
  void set_path(vector<int> path) { this->path = path; }
  friend ostream &operator<<(ostream &out, process p) {
    out << "args : \n";
    vector<string> args = p.get_args();
    vector<int> path = p.get_path();
    for (int i = 0; (i) < (int((args).size())); i++) {
      out << args[i] << " ";
    }
    out << endl;
    out << "path : \n";
    for (int i = 0; (i) < (int((path).size())); i++) {
      cout << path[i] << " ";
    }
    cout << endl;
    return out;
  }
};
vector<process> processes;
int main() {
  string str1, str2;
  cin >> str1 >> str2;
  vector<int> vi1, vi2;
  for (int i = 0; (i) < (int((str1).size())); i++) {
    if (str1[i] == '[')
      vi1.push_back(2);
    else if (str1[i] == '(')
      vi1.push_back(1);
    else
      vi1.push_back(3);
    i++;
  }
  for (int i = 0; (i) < (int((str2).size())); i++) {
    if (str2[i] == '[')
      vi2.push_back(2);
    else if (str2[i] == '(')
      vi2.push_back(1);
    else
      vi2.push_back(3);
    i++;
  }
  int cnt1 = 0, cnt2 = 0;
  for (int i = 0; (i) < (int((vi1).size())); i++) {
    if (vi1[i] == vi2[i])
      continue;
    else if (vi1[i] == 1) {
      if (vi2[i] == 2)
        cnt2++;
      else
        cnt1++;
    } else if (vi1[i] == 2) {
      if (vi2[i] == 3)
        cnt2++;
      else
        cnt1++;
    } else {
      if (vi2[i] == 1)
        cnt2++;
      else
        cnt1++;
    }
  }
  if (cnt1 > cnt2) {
    cout << "TEAM 1 WINS" << endl;
  } else if (cnt1 < cnt2) {
    cout << "TEAM 2 WINS" << endl;
  } else
    cout << "TIE" << endl;
  return 0;
}
