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.util.concurrent.ForkJoinTask;
import java.util.concurrent.RecursiveAction;
import java.util.concurrent.RecursiveTask;
import java.util.concurrent.atomic.AtomicInteger;
import java.io.*;
import java.lang.reflect.Field;
import java.lang.reflect.Method;
import java.math.*;

import javax.swing.plaf.SliderUI;

import static java.lang.Math.*;

public class Solution implements Runnable {
	
	public void solve() throws Exception {
		String a = sc.nextToken();
		String b = sc.nextToken();
		int scoreA = 0;
		int scoreB = 0;
		for (int i = 0; i < a.length(); i += 2) {
			String first = a.substring(i, i + 2);
			String second = b.substring(i, i + 2);
			switch (first) {
				case "[]": {
					if (second.equals("8<"))
						scoreB++;
					if (second.equals("()"))
						scoreA++;
					break;
				}
				case "()": {
					if (second.equals("8<"))
						scoreA++;
					if (second.equals("[]"))
						scoreB++;
					
					break;
				}
				case "8<": {
					if (second.equals("[]"))
						scoreA++;
					if (second.equals("()"))
						scoreB++;
					
					break;
				}
			}
		}
		if (scoreA > scoreB) {
			out.println("TEAM 1 WINS");
		} else if (scoreB > scoreA) {
			out.println("TEAM 2 WINS");
		} else {
			out.println("TIE");
		}
	}


	static Throwable t;

	BufferedReader in;
	FastScanner sc;
	PrintWriter out;

	@Override
	public void run() {
		try {
			in = new BufferedReader(new InputStreamReader(System.in));
			out = new PrintWriter(System.out);
			sc = new FastScanner(in);
			solve();
		} catch (Throwable t) {
			Solution.t = t;
		} finally {
			out.close();
		}
	}

	public static void main(String[] args) throws Throwable {
		Thread thread = new Thread(null, new Solution(), "", 1 << 26);
		thread.start();
		thread.join();
		if (Solution.t != null)
			throw t;
	}

}

class FastScanner {

	BufferedReader in;
	StringTokenizer st;

	public FastScanner(BufferedReader in) {
		this.in = in;
	}

	public String nextToken() throws Exception {
		while (st == null || !st.hasMoreTokens())
			st = new StringTokenizer(in.readLine());
		return st.nextToken();
	}

	public int nextInt() throws Exception {
		return Integer.parseInt(nextToken());
	}

	public long nextLong() throws Exception {
		return Long.parseLong(nextToken());
	}

	public double nextDouble() throws Exception {
		return Double.parseDouble(nextToken());
	}

}

interface ISingleton {
	
	public void doSomething();
	
}

class SingletonInjection {
	
	public static void inject(Class singletonClass, Object injection) throws Exception {
		Field field = singletonClass.getDeclaredField("instance");
		field.setAccessible(true);
		field.set(singletonClass, injection);
	}
	
}

class MockSingleton implements ISingleton {
	
	@Override
	public void doSomething() {
		// TODO Auto-generated method stub
		
	}
	
}

class Singleton implements ISingleton {
	
	private static ISingleton instance;
	
	public static ISingleton getInstance() {
		// create business singleton;
		return instance;
	}
	
	@Override
	public void doSomething() {
		// TODO Auto-generated method stub	
	}
	
}