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: /*
      This code is written by KESHAV DAGA
      @keshavkeshu
  */
  
  
  import java.util.*;
  import java.io.*;
  public class Main  
  {
      static FastReader in=new FastReader();
      static final Random random=new Random();
      static int mod=1000000007;
      static int inf=Integer.MAX_VALUE;
      static int ninf=Integer.MIN_VALUE;
      static HashMap<String,Integer>map=new HashMap<>();
      static String yes="YES",no="NO";
  
      public static void main(String args[]) throws IOException {
          /*
              This is main section or the coding part
              @keshavkeshu
          */
          int t=in.nextInt();
          StringBuilder res=new StringBuilder();
          while(t-->0)
          {
              // logic
              long a=in.nextLong();
              int b=in.nextInt();
              long x=in.nextLong();
              int y=in.nextInt();
              int min=min(b,y);
              b=b-min;
              y=y-min;
              if(Long.toString(a).length()+b != Long.toString(x).length()+y)
              {
                  if(Long.toString(a).length()+b<Long.toString(x).length()+y)
                      res.append("<\n");
                  else
                      res.append(">\n");
              }
              else
              {
                  while(b>y)
                  {
                      a=a*10;
                      b--;
                  }
                  while(y>b)
                  {
                      x=x*10;
                      y--;
                  }
                  if(x==a)
                      res.append("=\n");
                  else if(a<x)
                      res.append("<\n");
                  else
                      res.append(">\n");
              }
          }
          print(res);
      }
      
     
      
     
     
      
      static int max(int a, int b)
      {
          if(a<b)
          	return b;
          return a;
      }
      
      static int min(int a, int b)
      {
          if(a>b)
          	return b;
          return a;
      }
      
      static long max(long a, long b)
      {
          if(a<b)
          	return b;
          return a;
      }
      
      static long min(long a, long b)
      {
          if(a>b)
          	return b;
          return a;
      }
      static int max(int a, int b, int c)
      {
          if(a>b && a>c)
          	return a;
          else if(b>a && b>c)
              return b;
          else
              return c;
      }
      
      static int min(int a, int b, int c)
      {
          if(a<b && a<c)
          	return a;
          else if(b<a && b<c)
              return b;
          else
              return c;
      }
      
       
      static void ruffleSort(int[] a) {
          int n=a.length;
          for (int i=0; i<n; i++) {
              int oi=random.nextInt(n), temp=a[oi];
              a[oi]=a[i]; a[i]=temp;
          }
          Arrays.sort(a);
      }
  
      static < E > void print(E res)
      {
          System.out.println(res);
      }
      
     
      static  int gcd(int a,int b)
      {
          if(b==0)
          {
              return a;
          }
          return gcd(b,a%b);
      }
      
      static int lcm(int a, int b)
      {
          return (a / gcd(a, b)) * b;
      }
  
      
      static int abs(int a)
      {
          if(a<0)
              return -1*a;
          return a;
      }
  
      static class FastReader
      {
          BufferedReader br;
          StringTokenizer st;
  
          public FastReader()
          {
              br = new BufferedReader(new
                      InputStreamReader(System.in));
          }
  
          String next()
          {
              while (st == null || !st.hasMoreElements())
              {
                  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());
          }
          String nextLine()
          {
              String str = "";
              try
              {
                  str = br.readLine();
              }
              catch (IOException e)
              {
                  e.printStackTrace();
              }
              return str;
          }
  
          int [] ria(int n) {
              int res [] = new int [n];
              for(int i = 0; i<n; i++)res[i] = nextInt();
              return res;
          }
          long [] rla(int n) {
              long res [] = new long [n];
              for(int i = 0; i<n; i++)res[i] = nextLong();
              return res;
          }
      }
  
  }
  