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>
int FASTBUFFER;
using namespace std;
char s1[1005], s2[1005];
int a[4][4];
int main() {
  scanf("%s", s1 + 1);
  scanf("%s", s2 + 1);
  int w1 = 0, w2 = 0;
  a[1][3] = a[2][1] = a[3][2] = 1;
  for (int i = 1; s1[i]; i += 2) {
    int x1, x2;
    if (s1[i] == '8')
      x1 = 1;
    else if (s1[i] == '[')
      x1 = 3;
    else
      x1 = 2;
    if (s2[i] == '8')
      x2 = 1;
    else if (s2[i] == '[')
      x2 = 3;
    else
      x2 = 2;
    w1 += a[x1][x2];
    w2 += a[x2][x1];
  }
  if (w1 == w2)
    printf("TIE\n");
  else if (w1 > w2)
    printf("TEAM 1 WINS\n");
  else
    printf("TEAM 2 WINS\n");
  return 0;
}