#include <bits/stdc++.h>
using namespace std;
char a[10001], b[10001];
int main() {
  int ans1 = 0, ans2 = 0;
  gets(a);
  gets(b);
  int n = strlen(a);
  for (int i = 0; i <= n; i += 2) {
    if (a[i] == '8' && b[i] == '[') ans1++;
    if (a[i] == '(' && b[i] == '8') ans1++;
    if (a[i] == '[' && b[i] == '(') ans1++;
    if (b[i] == '8' && a[i] == '[') ans2++;
    if (b[i] == '(' && a[i] == '8') ans2++;
    if (b[i] == '[' && a[i] == '(') ans2++;
  }
  if (ans1 > ans2) cout << "TEAM 1 WINS";
  if (ans1 < ans2) cout << "TEAM 2 WINS";
  if (ans1 == ans2) cout << "TIE";
  return 0;
}
