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