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.io.*;
import java.util.*;

public class Main implements Runnable {

	public void _main() throws IOException {
		char[] a = next().toCharArray();
		char[] b = next().toCharArray();
		int res = 0;
		for (int i = 0; i < a.length; i += 2) {
			int u = decode(a[i]);
			int v = decode(b[i]);
			if ((u + 1) % 3 == v) {
				++res;
			} else if ((v + 1) % 3 == u) {
				--res;
			}
		}
		String[] str = {
				"TEAM 1 WINS",
				"TIE",
				"TEAM 2 WINS",
		};
		out.println(str[1 + Integer.signum(res)]);
	}

	private int decode(char ch) {
		if (ch == '(') {
			return 0; // rock
		}
		if (ch == '[') {
			return 1; // paper
		}
		if (ch == '8') {
			return 2; // scissors
		}
		return -1;
	}


	private BufferedReader in;
	private PrintWriter out;
	private StringTokenizer st;

	private String next() throws IOException {
		while (st == null || !st.hasMoreTokens()) {
			String rl = in.readLine();
			if (rl == null)
				return null;
			st = new StringTokenizer(rl);
		}
		return st.nextToken();
	}

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

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

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

	public static void main(String[] args) {
		Locale.setDefault(Locale.UK);
		new Thread(new Main()).start();
	}

	public void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
			//in = new BufferedReader(new FileReader("a.in"));
			//out = new PrintWriter(new FileWriter("a.out"));

			_main();

			out.close();
		} catch (Exception e) {
			e.printStackTrace();
			System.exit(202);
		}
	}

}