#include <bits/stdc++.h>
using namespace std;
int main() {
  std::string a;
  std::getline(cin, a);
  ;
  std::string b;
  std::getline(cin, b);
  ;
  int team1 = 0;
  int team2 = 0;
  for (int i = 0; i < a.size(); i = i + 2) {
    if (a[i] == b[i]) {
    } else if ((a[i] == '8' && b[i] == '[') || (a[i] == '[' && b[i] == '(') ||
               (a[i] == '(' && b[i] == '8')) {
      team1++;
    } else {
      team2++;
    }
  }
  if (team1 == team2) {
    cout << "TIE";
  } else if (team1 > team2) {
    cout << "TEAM 1 WINS";
  } else {
    cout << "TEAM 2 WINS";
  }
  return 0;
}
