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 JAVA):

Solution:
import java.util.*;
import java.io.*;

public class E {
	FastScanner in;
	PrintWriter out;

	int get(char c) {
		if (c == '8')
			return 0;
		if (c == '[')
			return 1;
		if (c == '(')
			return 2;
		return -1;
	}
	
	public void solve() throws IOException {
		char[] c = in.next().toCharArray();
		char[] t = in.next().toCharArray();
		int ans = 0;
		for (int i = 0; i < c.length; i+=2) {
			int x = get(c[i]);
			int y = get(t[i]);
			if (x != y) {
				if ((y + 3 - x) % 3 == 1) ans++;
				else ans--;
			}
		}
		if (ans < 0) {
			System.out.println("TEAM 2 WINS");
		} else if (ans > 0) {
			System.out.println("TEAM 1 WINS");	
		} else {
			System.out.println("TIE");
		}
	}

	public void run() {
		try {
			in = new FastScanner();
			out = new PrintWriter(System.out);

			solve();

			out.close();
		} catch (IOException e) {
			e.printStackTrace();
		}
	}

	class FastScanner {
		BufferedReader br;
		StringTokenizer st;

		FastScanner() {
			br = new BufferedReader(new InputStreamReader(System.in));
		}

		String next() {
			while (st == null || !st.hasMoreTokens()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

		int nextInt() {
			return Integer.parseInt(next());
		}

		long nextLong() {
			return Long.parseLong(next());
		}

		double nextDouble() {
			return Double.parseDouble(next());
		}
	}

	public static void main(String[] arg) {
		new E().run();
	}
}