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 java.io.BufferedReader;
  import java.io.IOException;
  import java.io.InputStreamReader;
  import java.io.PrintWriter;
  import java.util.Arrays;
  import java.util.Map;
  import java.util.StringTokenizer;
  
  public class A {
  
      void solve() throws IOException {
          int t = nextInt();
          go: for (int i = 0; i < t; ++i) {
              int x1 = nextInt();
              int p1 = nextInt();
              int x2 = nextInt();
              int p2 = nextInt();
              if (p1 == p2) {
                  if (x1 < x2) {
                      writer.println("<");
                  } else if (x1 > x2) {
                      writer.println(">");
                  } else {
                      writer.println("=");
                  }
              } else {
                  int length1 = 0;
                  int length2 = 0;
                  int t1 = x1;
                  while (t1 > 0) {
                      t1 /= 10;
                      ++length1;
                  }
                  int t2 = x2;
                  while (t2 > 0) {
                      t2 /= 10;
                      ++length2;
                  }
                  length1 += p1;
                  length2 += p2;
                  if (length1 > length2) {
                      writer.println(">");
                  } else if (length1 < length2) {
                      writer.println("<");
                  } else {
                      String a = String.valueOf(x1);
                      String b = String.valueOf(x2);
                      int j = 0;
                      int k = 0;
                      while (a.length() < b.length()) {
                          a += "0";
                      }
                      while (a.length() > b.length()) {
                          b += "0";
                      }
                      while (j < a.length() || k < b.length()) {
                          int d1 = a.charAt(j) - '0';
                          int d2 = b.charAt(k) - '0';
                          if (d1 < d2) {
                              writer.println("<");
                              continue go;
                          } else if (d1 > d2) {
                              writer.println(">");
                              continue go;
                          }
                          ++j;
                          ++k;
                      }
                      writer.println("=");
                  }
              }
          }
      }
  
      long rec(long[] arr, Map<String, Long> cache) {
          long maxSum = sum(arr);
          String key = Arrays.toString(arr);
          if (cache.containsKey(key))
              cache.get(key);
          for (int i = 0; i < arr.length; ++i) {
              for (int j = 0; j < arr.length; ++j) {
                  if (arr[j] >= arr[i] && arr[i] % 2 == 0 && arr[i] / 2 < arr[j] * 2) {
                      arr[i] /= 2;
                      arr[j] *= 2;
                      maxSum = Math.max(maxSum, rec(arr, cache));
                      arr[i] *= 2;
                      arr[j] /= 2;
                  }
              }
          }
          cache.put(key, maxSum);
          return maxSum;
      }
  
      long sum(long[] arr) {
          long sum = 0;
          for (long el : arr)
              sum += el;
          return sum;
      }
  
      long newSum(long[] arr, long sum) {
          long minEvenEl = Long.MAX_VALUE;
          int minEvenElInd = -1;
          for (int i = 0; i < arr.length; ++i) {
              long el = arr[i];
              if (el % 2 == 0 && el < minEvenEl) {
                  minEvenEl = el;
                  minEvenElInd = i;
              }
          }
          long maxJEl = minEvenEl;
          int maxJElInd = -1;
          for (int i = 0; i < arr.length; ++i) {
              long el = arr[i];
              if (i == minEvenElInd)
                  continue;
              if (el >= maxJEl) {
                  maxJEl = el;
                  maxJElInd = i;
              }
          }
          if (minEvenElInd == -1 || maxJElInd == -1)
              return -1;
          long bestJ = maxJEl;
          int bestJInd = maxJElInd;
          for (int i = 0; i < arr.length; ++i) {
              if (i == minEvenElInd)
                  continue;
              long el = arr[i];
              if (el <= bestJ && el > minEvenEl) {
                  bestJ = el;
                  bestJInd = i;
              }
          }
          arr[minEvenElInd] = minEvenEl / 2;
          arr[bestJInd] = bestJ * 2;
          return sum - minEvenEl + minEvenEl / 2 - bestJ + bestJ * 2;
      }
  
  
      String nextToken() throws IOException {
          while (tokenizer == null || !tokenizer.hasMoreTokens()) {
              tokenizer = new StringTokenizer(reader.readLine());
          }
          return tokenizer.nextToken();
      }
  
      int nextInt() throws IOException {
          return Integer.parseInt(nextToken());
      }
  
      StringTokenizer tokenizer;
      PrintWriter writer;
      BufferedReader reader;
  
      public void run() {
          try {
              writer = new PrintWriter(System.out);
              reader = new BufferedReader(new InputStreamReader(System.in));
              solve();
              reader.close();
              writer.close();
          } catch (Exception e) {
              e.printStackTrace();
          }
      }
  
      public static void main(String[] args) {
          new A().run();
      }
  }