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;
const long long int Maxn3 = 1e3 + 10;
const long long int Maxn4 = 1e4 + 10;
const long long int Maxn5 = 1e5 + 10;
const long long int Maxn6 = 1e6 + 10;
const long long int Maxn7 = 1e7 + 10;
const long long int Maxn8 = 1e8 + 10;
const long long int Maxn9 = 1e9 + 10;
const long long int Maxn18 = 1e18 + 10;
const long long int Mod1 = 1e7 + 7;
const long long int Mod2 = 1e9 + 7;
const long long int LLMax = LLONG_MAX;
const long long int LLMin = LLONG_MIN;
const long long int INTMax = INT_MAX;
const long long int INTMin = INT_MIN;
int main() {
  ios_base::sync_with_stdio(false), cin.tie(NULL), cout.tie(NULL);
  string a, b;
  cin >> a >> b;
  long long int x = 0, y = 0, s = a.size();
  for (long long int i = 0; i < s; i += 2)
    if ((a[i] == '[' and b[i] == '(') || (a[i] == '8' and b[i] == '[') ||
        (a[i] == '(' and b[i] == '8'))
      x++;
    else if ((a[i] == '[' and b[i] == '8') || (a[i] == '8' and b[i] == '(') ||
             (a[i] == '(' and b[i] == '['))
      y++;
  if (x > y)
    return cout << "TEAM 1 WINS", 0;
  else if (y > x)
    return cout << "TEAM 2 WINS", 0;
  return cout << "TIE", 0;
}