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.util.*;
  
  //import javax.swing.plaf.basic.BasicInternalFrameTitlePane.SystemMenuBar;
  
  import java.lang.*;
  import java.io.*;
  
  public class Main
  {
   public static class FastReader {
  
  		BufferedReader b;
  		StringTokenizer s;
  		public FastReader() {
  			b=new BufferedReader(new InputStreamReader(System.in));
  		}
  		String next() {
  			while(s==null ||!s.hasMoreElements()) {
  				try {
  					s=new StringTokenizer(b.readLine());
  				}
  				catch(IOException e) {
  					e.printStackTrace();
  				}
  			}
  			return s.nextToken();
  		}
  		public int nextInt() {
  			return Integer.parseInt(next());
  		}
  		public long nextLong() {
  			return Long.parseLong(next());
  		}
  		public double nextDouble() {
  			return Double.parseDouble(next());
  		}
  		
  		String nextLine() {
  			String str="";
  			try {
  				str=b.readLine();
  			}
  			catch(IOException e) {
  				e.printStackTrace();
  			}
  			return str;
  		}
  		boolean hasNext() {
  		    if (s != null && s.hasMoreTokens()) {
  		        return true;
  		    }
  		    String tmp;
  		    try {
  		        b.mark(1000);
  		        tmp = b.readLine();
  		        if (tmp == null) {
  		            return false;
  		        }
  		        b.reset();
  		    } catch (IOException e) {
  		        return false;
  		    }
  		    return true;
  		}
  	
  }
   /*static int LEN = 10000000;
   int lp[]=new int[LEN+1];
   List<Inter>
   public void sieve()
   {
  	 for (int i=2; i <= N; ++i) {
  		    if (lp[i] == 0) {
  		        lp[i] = i;
  		        pr.push_back(i);
  		    }
  		    for (int j=0; j < (int)pr.size() && pr[j] <= lp[i] && i*pr[j] <= N; ++j) {
  		        lp[i * pr[j]] = pr[j];
  		    }
  		}
   }*/
   
   public static long gcd(long a,long b) {if(a==0)return b; return gcd(b%a,a);}
   public static int gcd(int a,int b) {if(a==0)return b; return gcd(b%a,a);};
   
   static int power(int x, int y){
       if (y == 0)
           return 1;
       else if (y % 2 == 0)
           return power(x, y / 2) * power(x, y / 2);
       else
           return x * power(x, y / 2) * power(x, y / 2);
   }
   
   static long power(long x , long y)
   {
  	 if (y == 0)
           return 1;
       else if (y % 2 == 0)
           return power(x, y / 2) * power(x, y / 2);
       else
           return x * power(x, y / 2) * power(x, y / 2);
   }
  
  	
  	public static void main (String[] args) throws java.lang.Exception
  	{
  		
  		
  		long mod=1000000007;
  		
  		FastReader in=new FastReader();
  		if(in.hasNext()){
  		  
  		if(in.hasNext()){
  		
  		BufferedWriter log = new BufferedWriter(new OutputStreamWriter(System.out));
  		
  		int test=in.nextInt();
  		
  		while(test-->0)
  		{
  			String x1=in.next();
  			int p1=in.nextInt();
  			
  			String x2=in.next();
  			int p2=in.nextInt();
  			
  			
  			
  			
  			if((x1.length()+p1)>(x2.length()+p2))
  				System.out.println(">");
  			else
  				if((x1.length()+p1)<(x2.length()+p2))
  					System.out.println("<");
  				else
  				{
  					int x=0;
  					
  					int px1=0,px2=0;
  					boolean flag=true;
  					while(px1<x1.length()&&px2<x2.length())
  					{
  						if((x1.charAt(px1)-'0')>(x2.charAt(px2)-'0'))
  						{
  							flag=false;
  							x=1;
  							break;
  						}
  						else
  							if((x1.charAt(px1)-'0')<(x2.charAt(px2)-'0'))
  							{
  								flag=false;
  								x=-1;
  								break;
  								
  							}
  						
  						px1++;
  						px2++;
  					}
  					
  					while(flag&&px1<x1.length())
  					{
  						if(x1.charAt(px1)!='0')
  						{
  							x=1;
  							break;
  						}
  						px1++;
  					}
  					while(flag&&px2<x2.length())
  					{
  						if(x2.charAt(px2)!='0')
  						{
  							x=-1;
  							break;
  						}
  						px2++;
  					}
  					
  					if(x>0)
  						System.out.println(">");
  					else
  						if(x<0)
  							System.out.println("<");
  						else
  							System.out.println("=");
  				}
  					
  			
  		}
  		}
  }
  }
  }
  
  
  	
  
  