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.*;
  import java.math.BigInteger;
  import java.util.*;
  import java.util.concurrent.ThreadLocalRandom;
  
  public class Main extends Utils{
      public static void main(String[] args) {
          int t = readInt();
          while (t-- > 0) {
              String a1 = readString();
              int a2 = readInt();
              String b1 = readString();
              int b2 = readInt();
              if (a1.length() + a2 > b1.length() + b2)
                  println(">");
              else if (a1.length() + a2 < b1.length() + b2)
                  println("<");
              else {
                  long x = Long.parseLong(a1);
                  long y = Long.parseLong(b1);
                  if (a2 > b2) {
                      if (a2 - b2 > 10000000) {
                          println(">");
                          continue;
                      }
                      x *= pow(10L, a2 - b2);
                  } else if (a2 < b2) {
                      if (b2 - a2 > 10000000) {
                          println(">");
                          continue;
                      }
                      y *= pow(10, b2 - a2);
                  }
  
                  if (x > y)
                      println(">");
                  else if (x < y)
                      println("<");
                  else
                      println("=");
  
              }
          }
  
          flush();
      }
  }
  
  class Tuple {
      int _1;
      int _2;
  
      Tuple(int _1, int _2) {
          this._1 = _1;
          this._2 = _2;
      }
  }
  
  class DSU {
      int[] p;
  
      DSU(int size) {
          p = new int[size];
          Arrays.fill(p, -1);
      }
  
      int root(int u) {
          if (p[u] < 0) return u;
          return p[u] = root(p[u]);
      }
  
      void join(int u, int v) {
          int x = root(u);
          int y = root(v);
          if (x == y) return;
  
          if (p[y] < p[x]) {
              int t = x; x = y; y = t;
          }
          p[x] += p[y];
          p[y] = x;
      }
  }
  
  class ST {
      int size;
      HashSet<Integer>[] f;
  
      ST(int n) {
          size = 4 * Integer.highestOneBit(n);
          f = new HashSet[size];
      }
  
      /*void init() {
          for (int i = 0; i < size; i++)
              f[i] = new Tuple(0, 0);
      }*/
  
     /* private void down(int id) {
          f[(id << 1) + 1]._1 += f[id]._2;
          f[(id << 1) + 2]._1 += f[id]._2;
  
          f[(id << 1) + 1]._2 += f[id]._2;
          f[(id << 1) + 2]._2 += f[id]._2;
          f[id]._2 = 0;
      }*/
  
      /*HashSet[] merge(HashSet<Integer> x, HashSet<Integer> y) {
          int[] rs = new int[(x.length) + y.length];
          int i = 0, j = 0, idx = 0;
          while (i < x.length && j < y.length) {
              if (x[i] < y[j])
                  rs[idx++] = x[i++];
              else
                  rs[idx++] = y[j++];
          }
  
          while (i < x.length)
              rs[idx++] = x[i++];
          while (j < y.length)
              rs[idx++] = y[j++];
          return rs;
      }*/
  
      void build(int id, int l, int r, int[] a) {
          if (l == r) {
              f[id] = new HashSet<>();
              f[id].add(a[l]);
              return;
          }
          int mid = (l + r) >> 1;
          build((id << 1) + 1, l, mid, a);
          build((id << 1) + 2, mid + 1, r, a);
          f[id] = new HashSet<>();
          f[id].addAll(f[(id << 1) + 1]);
          f[id].addAll(f[(id << 1) + 2]);
      }
  
      /*void update(int id, int l, int r, int u, int v, int[] a, int value) {
          if (u > r || v < l) return;
          if (u <= l && r <= v) {
              f[id].update(a[u], value);
              return;
          }
          //down(id);
          int mid = (l + r) >> 1;
          update((id << 1) + 1, l, mid, u, v, a, value);
          update((id << 1) + 2, mid + 1, r, u, v, a, value);
          BIT x = f[(id << 1) + 1];
          BIT y = f[(id << 1) + 2];
          for (int i = 0; i <= 10000; i++)
              f[id].bit[i] = x.bit[i] + y.bit[i];
      }*/
  
      HashSet<Integer> get(int id, int l, int r, int u, int v) {
          if (u > r || v < l) return new HashSet<>();
          if (u <= l && r <= v) {
              return f[id];
          }
          //down(id);
          int mid = (l + r) >> 1;
          HashSet<Integer> rs = new HashSet<>();
          rs.addAll(get((id << 1) + 1, l, mid, u, v));
          rs.addAll(get((id << 1) + 2, mid + 1, r, u, v));
          return rs;
      }
  }
  
  class BIT {
      int n;
      int[] bit;
  
      BIT(int n) {
          this.n = n;
          bit = new int[n + 1];
      }
  
      void update_dec(int i, int value) {
          for (; i > 0; i -= i & (-i))
              bit[i] += value;
      }
  
      void update_inc(int i, int value) {
          for (; i <= n; i += i & (-i))
              bit[i] += value;
      }
  
      int get_inc(int i) {
          int rs = 0;
          for (; i <= n; i += i & (-i))
              rs += bit[i];
          return rs;
      }
  
      int get_dec(int i) {
          int rs = 0;
          for (; i > 0; i -= i & (-i))
              rs += bit[i];
          return rs;
      }
  
  }
  
  class LCA {
      int[][] rmq;
      long[][] len;
      int[] d;
      int maxH;
  
      LCA (int n, int root, ArrayList<int[]>[] e) {
          maxH = (int)(Math.log(n) / Math.log(2) + 1);
  
          d = new int[n];
          rmq = new int[n][maxH + 1];
          len = new long[n][maxH + 1];
  
          dfs(root, n, e);
      }
  
      long get(int u, int v) {
          if (d[u] < d[v]) {
              int t = u; u = v; v = t;
          }
  
          long slen = 0;
          for (int i = maxH; i >= 0; i--)
              if (d[u] - d[v] >= (1 << i)) {
                  slen += len[u][i];
                  u = rmq[u][i];
              }
  
          if (u == v) return slen;
  
          for (int i = maxH; i >= 0; i--)
              if (rmq[u][i] != rmq[v][i]) {
                  slen += len[u][i] + len[v][i];
                  u = rmq[u][i];
                  v = rmq[v][i];
              }
  
          slen += len[u][0] + len[v][0];
  
          return slen;
      }
  
      int query(int _u, int _v, int k) {
          int u = _u, v = _v;
          if (d[u] < d[v]) {
              int t = u; u = v; v = t;
          }
  
          for (int i = maxH; i >= 0; i--)
              if (d[u] - d[v] >= (1 << i))
                  u = rmq[u][i];
  
          int p = 0;
          if (u == v)
              p = u;
          else {
              for (int i = maxH; i >= 0; i--)
                  if (rmq[u][i] != rmq[v][i]) {
                      u = rmq[u][i];
                      v = rmq[v][i];
                  }
              p = rmq[u][0];
          }
  
          if (d[_u] - d[p] >= k) {
              for (int i = maxH; i >= 0; i--) {
                  if (d[_u] - d[p] >= k && k >= (1 << i)) {
                      _u = rmq[_u][i];
                      k -= 1 << i;
                  }
              }
              return _u;
          } else {
              k -= d[_u] - d[p];
              k = d[_v] - d[p] - k;
              for (int i = maxH; i >= 0; i--) {
                  if (d[_v] - d[p] >= k && k >= (1 << i)) {
                      _v = rmq[_v][i];
                      k -= 1 << i;
                  }
              }
              return _v;
          }
      }
  
      private void dfs(int u, int n, ArrayList<int[]>[] e) {
          for (int[] vw : e[u]) {
              int v = vw[0];
              int w = vw[1];
              if (v != rmq[u][0]) {
                  rmq[v][0] = u;
                  len[v][0] = w;
  
                  for (int i = 1; (1 << i) <= n; i++) {
                      rmq[v][i] = rmq[rmq[v][i - 1]][i - 1];
                      len[v][i] =len[rmq[v][i - 1]][i - 1] + len[v][i - 1];
                  }
                  d[v] = d[u] + 1;
                  dfs(v, n, e);
              }
          }
      }
  }
  
  class HLD {
      int size, nChain;
      int[] headChain, chain, parent, pos, value;
      int[] st;
  
      HLD(int n, int root, ArrayList<Integer>[] e) {
          nChain = 0;
          size = 0;
          headChain = new int[n];
          chain = new int[n];
          pos = new int[n];
          parent = new int[n];
          value = new int[n];
  
          dfs(root, e);
  
          st = new int[4 * Integer.highestOneBit(size)];
          Arrays.fill(st, -2);
      }
  
      private void dfs(int u, ArrayList<Integer>[] e) {
          if (headChain[nChain] == 0)
              headChain[nChain] = u;
  
          chain[u] = nChain;
          pos[u] = size;
          value[size++] = 0;
  
          int maxV = -1;
          ArrayList<Integer> remain = new ArrayList<>();
          for (Integer v : e[u]) {
              if (v != parent[u]) {
                  parent[v] = u;
                  if (maxV < 0)
                      maxV = v;
                  else {
                      if (e[maxV].size() < e[v].size()) {
                          remain.add(maxV);
                          maxV = v;
                      } else
                          remain.add(v);
                  }
              }
          }
  
          if (maxV > 0)
              dfs(maxV, e);
  
          for (Integer v: remain) {
              nChain++;
              dfs(v, e);
          }
  
      }
  
      int get(int u, int v) {
          int rs = -2;
          while(true) {
              if (pos[u] < pos[v]) {
                  int t = u; u = v; v = t;
              }
              if (chain[u] == chain[v]) {
                  int _rs = Math.max(rs, get(0, 0, size - 1, pos[v], pos[u]));
                  if (_rs > 0)
                      rs = _rs;
                  break;
              }
  
              int _rs = Math.max(rs, get(0, 0, size - 1, pos[headChain[chain[u]]], pos[u]));
              if (_rs > 0)
                  rs = _rs;
              u = parent[headChain[chain[u]]];
          }
          return rs;
      }
  
      void update(int u) {
          value[pos[u]] = value[pos[u]] == 1 ? 0 : 1;
          update(0, 0, size - 1, pos[u], u);
      }
  
      private void build(int id, int l, int r) {
          if (l == r) {
              st[id] = value[l];
              return;
          }
          int mid = (l + r) >> 1;
          build((id << 1) + 1, l, mid);
          build((id << 1) + 2, mid + 1, r);
          st[id] = Math.max(st[(id << 1) + 1], st[(id << 1) + 2]);
      }
  
      private void update(int id, int l, int r, int i, int v) {
          if (i < l || r < i) return;
          if (l == i && i == r) {
              st[id] = value[i] == 0 ? -2 : v;
              return;
          }
          int mid = (l + r) >> 1;
          update((id << 1) + 1, l, mid, i, v);
          update((id << 1) + 2, mid + 1, r, i, v);
          st[id] = st[(id << 1) + 1] > 0 ? st[(id << 1) + 1] : st[(id << 1) + 2];
      }
  
      private int get(int id, int l, int r, int u, int v) {
          if (u > r || v < l) return -2;
          if (u <= l && r <= v) return st[id];
          int mid = (l + r) >> 1;
          int rs1 = get((id << 1) + 1, l, mid, u, v);
          int rs2 = get((id << 1) + 2, mid + 1, r, u, v);
          return rs1 > 0 ? rs1 : rs2;
      }
  }
  
  abstract class Utils {
      static PrintWriter writer = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)));
      static BufferedReader reader = new BufferedReader(new InputStreamReader(System.in));
      static StringTokenizer st = new StringTokenizer("");
  
      static void print(Object s) {
          writer.print(s);
      }
  
      static void println(Object s) {
          writer.println(s);
      }
  
      static void println() {
          writer.println();
      }
  
      static void flush() {
          writer.close();
      }
  
      static String next() {
          while (!st.hasMoreTokens()) {
              try {
                  st = new StringTokenizer(reader.readLine());
              } catch (IOException e) {
                  e.printStackTrace();
              }
          }
          return st.nextToken();
      }
  
      static int readInt() {
          return Integer.parseInt(next());
      }
  
      static long readLong() {
          return Long.parseLong(next());
      }
  
      static char[] readStr() {
          return next().toCharArray();
      }
  
      static String readString() {
          return next();
      }
  
      static char readChar() {
          return next().charAt(0);
      }
  
      static int[] readArrayInt(int n) {
          int[] a = new int[n];
          for(int i = 0; i < n; i++)
              a[i] = readInt();
          return a;
      }
  
      static BigInteger pow(BigInteger a, BigInteger b) {
          if (b.compareTo(BigInteger.valueOf(0)) == 0) return BigInteger.valueOf(1);
          BigInteger rs = pow(a, (b.divide(BigInteger.valueOf(2))));
          return rs.multiply(rs).multiply(b.mod(BigInteger.valueOf(2)).compareTo(BigInteger.ZERO) == 0 ? BigInteger.ONE : a);
      }
  
      static long pow(long a, long b) {
          if (b == 0) return 1;
  
          long rs = pow(a, b / 2);
          return rs * rs * (b % 2 == 0 ? 1 : a);
      }
  
      static long GCD(long a, long b) {
          if (a == 0) return b;
          return GCD(b % a, a);
      }
  
      static long LCM(long a, long b) {
          return (a / GCD(a,b)) * b;
      }
  
      static void shuffle(int[][] a) {
          Random rand = ThreadLocalRandom.current();
          for (int i = a.length - 1; i >= 0; i--) {
              int idx = rand.nextInt(i + 1);
              int[] t = a[idx];
              a[idx] = a[i];
              a[i] = t;
          }
      }
  
      static void swap(int a, int b) {
          int t = a; a = b; b = t;
      }
  }
  
  
  