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