You need to handle two extraordinarily large integers. The good news is that you don't need to perform any arithmetic operation on them. You just need to compare them and see whether they are equal or one is greater than the other.

Given two strings x and y, print either "x< y"(ignore space, editor issues), "x>y" or "x=y" depending on the values represented by x and y. x and y each consist of a decimal integer followed zero or more '!' characters. Each '!' represents the factorial operation. For example, "3!!" represents 3!! = 6! = 720.

Input - First line of input contains no. of testcases and each test consist of 2 lines x and y.

Ouptut - Print the required output.

SAMPLE INPUT
3
0!
1
9!!
999999999
456!!!
123!!!!!!

SAMPLE OUTPUT
x=y
x>y
x<y
import math,string,re
class ExtraordinarilyLarge:
	def compare(self, x, y):
		if x.startswith("0!"):
			x = "1" + x[2:]
		if y.startswith("0!"):
			y = "1" + y[2:]
		nx = re.findall(r"\d+", x)[0]
		ny = re.findall(r"\d+", y)[0]
		xf = len(x) - len(nx)
		yf = len(y) - len(ny)
		nx = int(nx)
		ny = int(ny)
		while xf > yf:
			newx = 1
			for i in range(nx, 1, -1):
				newx *= i
				if newx > ny:
					return "x>y"
			nx = newx
			xf -= 1
 
		while yf > xf:
			newy = 1
			for i in range(ny, 1, -1):
				newy *= i
				if newy > nx:
					return "x<y"
			ny = newy
			yf -= 1
 
		if nx < ny:
			return "x<y"
		if nx > ny:
			return "x>y"
		return "x=y"
 
e=ExtraordinarilyLarge()
for i in range(int(input())):
        print(e.compare(raw_input(),raw_input()))