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