description: Monocarp wrote down two numbers on a whiteboard. Both numbers follow a specific format: a positive integer x with p zeros appended to its end.
  
  Now Monocarp asks you to compare these two numbers. Can you help him?
  
  Input
  
  The first line contains a single integer t (1 ≤ t ≤ 10^4) — the number of testcases.
  
  The first line of each testcase contains two integers x_1 and p_1 (1 ≤ x_1 ≤ 10^6; 0 ≤ p_1 ≤ 10^6) — the description of the first number.
  
  The second line of each testcase contains two integers x_2 and p_2 (1 ≤ x_2 ≤ 10^6; 0 ≤ p_2 ≤ 10^6) — the description of the second number.
  
  Output
  
  For each testcase print the result of the comparison of the given two numbers. If the first number is smaller than the second one, print '<'. If the first number is greater than the second one, print '>'. If they are equal, print '='.
  
  Example
  
  Input
  
  
  5
  2 1
  19 0
  10 2
  100 1
  1999 0
  2 3
  1 0
  1 0
  99 0
  1 2
  
  
  Output
  
  
  &gt;
  =
  &lt;
  =
  &lt;
  
  Note
  
  The comparisons in the example are: 20 > 19, 1000 = 1000, 1999 < 2000, 1 = 1, 99 < 100.
solution: import os, sys
  from io import BytesIO, IOBase
  from collections import defaultdict, Counter
  
  BUFSIZE = 8192
   
   
  class FastIO(IOBase):
      newlines = 0
   
      def __init__(self, file):
          self._fd = file.fileno()
          self.buffer = BytesIO()
          self.writable = "x" in file.mode or "r" not in file.mode
          self.write = self.buffer.write if self.writable else None
   
      def read(self):
          while True:
              b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
              if not b:
                  break
              ptr = self.buffer.tell()
              self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
          self.newlines = 0
          return self.buffer.read()
   
      def readline(self):
          while self.newlines == 0:
              b = os.read(self._fd, max(os.fstat(self._fd).st_size, BUFSIZE))
              self.newlines = b.count(b"\n") + (not b)
              ptr = self.buffer.tell()
              self.buffer.seek(0, 2), self.buffer.write(b), self.buffer.seek(ptr)
          self.newlines -= 1
          return self.buffer.readline()
   
      def flush(self):
          if self.writable:
              os.write(self._fd, self.buffer.getvalue())
              self.buffer.truncate(0), self.buffer.seek(0)
   
   
  class IOWrapper(IOBase):
      def __init__(self, file):
          self.buffer = FastIO(file)
          self.flush = self.buffer.flush
          self.writable = self.buffer.writable
          self.write = lambda s: self.buffer.write(s.encode("ascii"))
          self.read = lambda: self.buffer.read().decode("ascii")
          self.readline = lambda: self.buffer.readline().decode("ascii")
   
   
  sys.stdin, sys.stdout = IOWrapper(sys.stdin), IOWrapper(sys.stdout)
  input = lambda: sys.stdin.readline().rstrip("\r\n")
  from math import ceil
  mod = 10 ** 9 + 7 
  # number of test cases
  ans = []
  for _ in range(int(input())):          
      x1, p1 = map(int, input().split())
      x2, p2 = map(int, input().split())
      n1 = str(x1)
      idx1 = len(n1)
      for i in range(len(n1) - 1, -1, -1):
          if n1[i] == '0':
              idx1 = i
              continue
          else: break
      n2 = str(x2)
      idx2 = len(n2)
      for i in range(len(n2) - 1, -1, -1):
          if n2[i] == '0':
              idx2 = i
              continue
          else: break    
      a = len(str(x1)[:idx1]) + p1 + len(n1) - idx1
      b = len(str(x2)[:idx2]) + p2 + len(n2) - idx2
      if a < b:
          ans.append("<")
      elif a > b:
          ans.append(">")
      else:
          # check
          num1 = str(x1)[:idx1]
          num2 = str(x2)[:idx2]
          smaller = 0
          for i in range(min(len(num1), len(num2))):
              if num1[i] < num2[i]:             
                  smaller = 1
                  break
              elif num1[i] > num2[i]:
                  smaller = 2
                  break
          if smaller == 0:
              if len(num2) < len(num1):
                  smaller = 2
              elif len(num1) < len(num2):
                  smaller = 1        
          if smaller == 0:
              ans.append("=")
          elif smaller == 1: ans.append("<")        
          else: ans.append(">")
  for i in ans:
      print(i)        