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;
void put(int x) {
  if (x < 0) {
    putchar('-');
    x *= -1;
  }
  if (x == 0) {
    putchar('0');
  }
  int num = 0;
  char c[15];
  while (x) {
    c[++num] = (x % 10) + 48;
    x /= 10;
  }
  while (num) {
    putchar(c[num--]);
  }
  putchar('\n');
}
inline void in(int &x) {
  char ch = getchar();
  int flag = 1;
  while (!(ch >= '0' && ch <= '9')) {
    if (ch == '-') flag *= -1;
    ch = getchar();
  }
  x = ch - '0';
  ch = getchar();
  while (ch >= '0' && ch <= '9') {
    x = ((x << 3) + (x << 1)) + ch - '0';
    ch = getchar();
  }
  x *= flag;
}
string s1, s2;
int sum1, sum2;
int work(char a, char b) {
  if (a == '8' && b == '<') return 1;
  if (a == '(' && b == ')') return 2;
  if (a == '[' && b == ']') return 3;
}
int main() {
  cin >> s1 >> s2;
  for (int i = 0; i < s1.size(); i += 2) {
    int k1 = work(s1[i], s1[i + 1]), k2 = work(s2[i], s2[i + 1]);
    if ((k1 == 1 && k2 == 2) || (k1 == 2 && k2 == 3) || (k1 == 3 && k2 == 1))
      sum2++;
    else if (k1 == k2)
      continue;
    else
      sum1++;
  }
  if (sum1 > sum2) printf("TEAM 1 WINS\n");
  if (sum1 == sum2) printf("TIE\n");
  if (sum1 < sum2) printf("TEAM 2 WINS\n");
  return 0;
}