Problem: Two teams meet in The Game World Championship. Some scientists consider this game to be the most intellectually challenging game in the world. You are given two strings describing the teams' actions in the final battle. Figure out who became the champion.

Input

The input contains two strings of equal length (between 2 and 20 characters, inclusive). Each line describes the actions of one team.

Output

Output "TEAM 1 WINS" if the first team won, "TEAM 2 WINS" if the second team won, and "TIE" if there was a tie.

Examples

Input

[]()[]8&lt;
8&lt;[]()8&lt;


Output

TEAM 2 WINS


Input

8&lt;8&lt;()
[]8&lt;[]


Output

TIE

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
template <class F, class T>
T convert(F a, int p = -1) {
  stringstream ss;
  if (p >= 0) ss << fixed << setprecision(p);
  ss << a;
  T r;
  ss >> r;
  return r;
}
template <class T>
T gcd(T a, T b) {
  T r;
  while (b != 0) {
    r = a % b;
    a = b;
    b = r;
  }
  return a;
}
template <class T>
T lcm(T a, T b) {
  return a / gcd(a, b) * b;
}
template <class T>
T sqr(T x) {
  return x * x;
}
template <class T>
T cube(T x) {
  return x * x * x;
}
template <class T>
int getbit(T s, int i) {
  return (s >> i) & 1;
}
template <class T>
T onbit(T s, int i) {
  return s | (T(1) << i);
}
template <class T>
T offbit(T s, int i) {
  return s & (~(T(1) << i));
}
template <class T>
int cntbit(T s) {
  return s == 0 ? 0 : cntbit(s >> 1) + (s & 1);
}
template <class T>
int disp(T s) {
  for (__typeof(((s)).begin()) it = ((s)).begin(); it != ((s)).end(); ++it)
    cout << *it << " ";
  cout << endl;
}
template <class T>
int disp(T s, int n) {
  for (int i = (1); i <= (n); ++i) cout << s[i] << " ";
  cout << '\n';
}
const long double PI = acos(-1.0);
const long double eps = 1e-9;
const int dr[] = {-1, 0, +1, 0, -1, -1, +1, +1};
const int dc[] = {0, +1, 0, -1, -1, +1, -1, +1};
const int inf = (int)1e9 + 5;
const long long linf = (long long)1e16 + 5;
const long long mod = (long long)1e9 + 7;
const int MX = (int)2e5 + 5;
string s1, s2;
int main() {
  std::ios::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> s1 >> s2;
  int ans1 = 0;
  int ans2 = 0;
  for (int i = 0; i < (((int)(s1).size())); ++i) {
    if (i & 1) continue;
    if (s1[i] == '[') {
      if (s2[i] == '(')
        ans1++;
      else if (s2[i] == '8')
        ans2++;
    }
    if (s1[i] == '(') {
      if (s2[i] == '8')
        ans1++;
      else if (s2[i] == '[')
        ans2++;
    }
    if (s1[i] == '8') {
      if (s2[i] == '[')
        ans1++;
      else if (s2[i] == '(')
        ans2++;
    }
  }
  if (ans1 > ans2) {
    cout << "TEAM 1 WINS" << '\n';
  } else if (ans1 == ans2) {
    cout << "TIE" << '\n';
  } else {
    cout << "TEAM 2 WINS" << '\n';
  }
}