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.util.*;
  public class A{
  	public static void main(String[] args){
  		FastReader sc = new FastReader();
  		int t=sc.nextInt();
  		next:while(t-->0){
  			int a=sc.nextInt();
  			int z1=sc.nextInt();
  			int b=sc.nextInt();
  			int z2=sc.nextInt();
  			int l1=z1+size(a);
  			int l2=z2+size(b);
  //			System.out.println(l1+" "+l2);
  			if(l1<l2)System.out.println('<');
  			else if(l1>l2)System.out.println('>');
  			else {
  				ArrayList<Integer> a1= new ArrayList<Integer>(); 
  				ArrayList<Integer> a2= new ArrayList<Integer>(); 
  				while(a%10==0) {
  					z1++;
  					a/=10;
  				}
  				while(b%10==0) {
  					z2++;
  					b/=10;
  				}
  				while(a>9) {
  					a1.add(a%10);
  					a/=10;
  				}
  				a1.add(a);
  				while(b>9) {
  					a2.add(b%10);
  					b/=10;
  				}
  				a2.add(b);
  //				print(a1);
  //				print(a2);
  				while(a1.size()>0&&a2.size()>0) {
  					int i=a1.size();int j=a2.size();
  					if(a1.get(i-1)>a2.get(j-1)) {
  						System.out.println('>');
  						continue next;
  					}else if(a1.get(i-1)<a2.get(j-1)) {
  						System.out.println('<');
  						continue next;
  					}
  					a1.remove(a1.size()-1);
  					a2.remove(a2.size()-1);
  				}
  				if(a1.size()>0)System.out.println('>');
  				else if(a2.size()>0)System.out.println('<');
  				else System.out.println('=');
  //				System.out.println(a1.size()+" "+a2.size());
  
  			}
  			
  			
  		}		 
      }
  	static int size(int x) {
  		int a=1;
  		while(x>9) {
  			x/=10;
  			a++;
  		}
  		return a;
  	}
  	static class pair {
  		int x;int y;
  		 pair(int x,int y){
  			this.x=x;
  			this.y=y;
  		}
  		
  	}
  	static void sort(int a[]) {
  		ArrayList<Integer> aa= new ArrayList<>();
  		for(int i:a)aa.add(i);
  		Collections.sort(aa);
  		int j=0;
  		for(int i:aa)a[j++]=i;
  	}
  	static ArrayList<Integer> primeFac(int n){
  		ArrayList<Integer>ans = new ArrayList<Integer>();
  		int lp[]=new int [n+1];
  		Arrays.fill(lp, 0);  	//0-prime
  		for(int i=2;i<=n;i++) {
  			if(lp[i]==0) {
  				for(int j=i;j<=n;j+=i) {
  					if(lp[j]==0) lp[j]=i;
  				}
  			}
  		}
  		int fac=n;
  		while(fac>1) {
  			ans.add(lp[fac]);
  			fac=fac/lp[fac];
  		}
  		print(ans);
  		return ans;
  	}
  	static ArrayList<Long> prime_in_given_range(long l,long r){
  		ArrayList<Long> ans= new ArrayList<>();
  		int n=(int)Math.sqrt(r)+1;
  		int prime[]=sieve_of_Eratosthenes(n);
  		long res[]=new long [(int)(r-l)+1];
  		for(int i=0;i<=r-l;i++) {
  			res[i]=i+l;
  		}
  		for(int i=0;i<prime.length;i++) {
  			if(prime[i]==1) {
  				System.out.println(2);
  				for(int j=Math.max((int)i*i, (int)(l+i-1)/i*i);j<=r;j+=i) {
  					res[j-(int)l]=0; 
  				}
  			}
  		}
  		for(long i:res) if(i!=0)ans.add(i);
  		return ans;
  	}
  	static int [] sieve_of_Eratosthenes(int n) {
  		int prime[]=new int [n];
  		Arrays.fill(prime, 1);  // 1-prime | 0-not prime
  		prime[0]=prime[1]=0;
  		for(int i=2;i<n;i++) {
  			if(prime[i]==1) {
  				for(int j=i*i;j<n;j+=i) {
  					prime[j]=0;
  				}
  			}
  		}
  		return prime;
  	}
  	static long binpow(long a,long b) {
  		long res=1;
  		if(b==0)return a;
  		if(a==0)return 1;
  		while(b>0) {
  			if((b&1)==1) {
  				res*=a;
  			}
  			a*=a;
  			b>>=1;
  		}
  		return res;
  	}
  	static void print(int a[]) {
  		System.out.println(a.length);
  		for(int i:a) {
  			System.out.print(i+" ");
  		}
  		System.out.println();
  	}
  	static void print(long a[]) {
  		System.out.println(a.length);
  		for(long i:a) {
  			System.out.print(i+" ");
  		}
  		System.out.println();
  	}
  	static void print(ArrayList<Integer> a) {
  		System.out.println(a.size());
  		for(long i:a) {
  			System.out.print(i+" ");
  		}
  		System.out.println();
  	}
  	static class FastReader {
  		BufferedReader br;
  		StringTokenizer st;
  
  		public FastReader()
  		{
  			br = new BufferedReader(
  				new InputStreamReader(System.in));
  		}
  		int [] fastArray(int n) {
  			int a[]=new int [n];
  			for(int i=0;i<n;i++) {
  				a[i]=nextInt();
  			}
  			return a;
  		}
  		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;
  		}
  	}
  
  }