Find the minimum area of a square land on which you can place two identical rectangular a × b houses. The sides of the houses should be parallel to the sides of the desired square land.

Formally, 

  * You are given two identical rectangles with side lengths a and b (1 ≤ a, b ≤ 100) — positive integers (you are given just the sizes, but not their positions). 
  * Find the square of the minimum area that contains both given rectangles. Rectangles can be rotated (both or just one), moved, but the sides of the rectangles should be parallel to the sides of the desired square. 



Two rectangles can touch each other (side or corner), but cannot intersect. Rectangles can also touch the sides of the square but must be completely inside it. You can rotate the rectangles. Take a look at the examples for a better understanding.

<image> The picture shows a square that contains red and green rectangles.

Input

The first line contains an integer t (1 ≤ t ≤ 10 000) —the number of test cases in the input. Then t test cases follow.

Each test case is a line containing two integers a, b (1 ≤ a, b ≤ 100) — side lengths of the rectangles.

Output

Print t answers to the test cases. Each answer must be a single integer — minimal area of square land, that contains two rectangles with dimensions a × b.

Example

Input


8
3 2
4 2
1 1
3 1
4 7
1 3
7 4
100 100


Output


16
16
4
9
64
9
64
40000

Note

Below are the answers for the first two test cases: 

<image> <image>
import java.util.*;
import java.io.*;
public class Codeforces3{
	public static void main(String[] args)throws IOException {
		BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
		StringTokenizer st=new StringTokenizer(br.readLine());
		int t=Integer.parseInt(st.nextToken());
		for(int i=0;i<t;i++)
		{	
			st=new StringTokenizer(br.readLine());
			long a=Long.parseLong(st.nextToken());
			long b=Long.parseLong(st.nextToken());
			if(a==b)
				System.out.println((a*2)*(a*2));
			else
			{
				long min=a>b?b:a;
				if(min==a)
				{
					long sum=2*a;
					if(sum>b)
						System.out.println((sum)*(sum));
					else
						System.out.println((b)*(b));
				}
				else
				{
					long sum=2*b;
					if(sum>a)
						System.out.println((sum)*(sum));
					else
						System.out.println((a)*(a));
				}
			}
		}
	}
	//0/1 knapsack
		 static int maxValue(int n,int weight,int v[],int w[])
		 {
		     int arr[][]=new int[n][weight+1];
		     for(int i=0;i<n;i++)
		        arr[i][0]=0;
		     for(int i=0;i<n;i++)
		     {
		         for(int j=1;j<=weight;j++)
		         {
		             if(i==0)
		             {
		                 if(w[i]<=j)
		                    arr[i][j]=v[i];
		                 else
		                    arr[i][j]=0;
		             }
		             else
		             {
		                 if(w[i]>j)
		                 {
		                     arr[i][j]=arr[i-1][j];
		                 }
		                 else
		                 {
		                     arr[i][j]=Math.max(v[i]+arr[i-1][j-w[i]],arr[i-1][j]);
		                 }
		             }
		         }
		     }
		    
		     return arr[n-1][weight];
		 }
		//calculate (m+n)!/(m!*n!)
		static int maxPath(int m,int n)
		{
		    
		    if(m==1 || n==1)
		        return 1;
		   m--;n--;
		   if(m<n)
		   {
		       m=m+n;
		       n=m-n;
		       m=m-n;
		   }
		   int res=1,j=1;
		   for(int i=m+1;i<=(m+n);i++,j++)
		   {
		       res*=i;
		       res/=j;
		   }
		   return res;
		}
		static int modDivide(int a,int b,int m)
		{
		    a = a % m ;
	        int inv = modInverse(b,m);
	        System.out.println("inv "+inv);
	        if(inv==-1)
	            return -1;
	        return (inv*a) % m;
		}
		static int modInverse(int b,int m)
		{
		    int g=gcd(b,m);
		    
		    if(g!=1)
		        return -1;
		    //If b and m are relatively prime,  
	        //then modulo inverse is b^(m-2) mode 
	      return power(b,m-2,m);
		}
		// a^p%m
		static int power(int x, int y, int p) 
	    { 
	        // Initialize result 
	        int res = 1;      
	         
	        // Update x if it is more   
	        // than or equal to p 
	        x = x % p;  
	  
	       if (x == 0) return 0; // In case x is divisible by p;    
	  
	        while (y > 0) 
	        { 
	            // If y is odd, multiply x 
	            // with result 
	            if((y & 1)==1) 
	                res = (res * x) % p; 
	      
	            // y must be even now 
	            // y = y / 2 
	            y = y >> 1;  
	            x = (x * x) % p;  
	        } 
	        return res; 
	    } 
	    
		//Euclidean algorithms
		static int gcd(int a, int b) 
	    { 
	        if (a == 0) 
	            return b; 
	          
	        return gcd(b%a, a); 
	    } 
		static int[] array(StringTokenizer st,int a)
		{
			int y[]=new int[a];
			int p=0;
			while(st.hasMoreTokens())
			{
				y[p]=Integer.parseInt(st.nextToken());
				p++;
			}
			return y;
		}
		 static int lis(int arr[])
		 {
		     int lis[]=new int[arr.length];
		     for(int i=0;i<arr.length;i++)
		        lis[i]=1;
		     for(int i=1;i<arr.length;i++)
		     {
		         for(int j=0;j<i;j++)
		         {
		             if(arr[i]>arr[j] && lis[i]<lis[j]+1)
		                lis[i]=lis[j]+1;
		         }
		     }
		     int max=1;
		     for(int i=0;i<lis.length;i++)
		        if(lis[i]>max)
		            max=lis[i];
		   return max;
		 }
		 static long max(long a)
		{
			long max=0;
			while(a>0)
			{
				if(a%10>max)
				{
					max=a%10;
				}
				a/=10;
			}
			return max;
		}
		static long min(long a)
		{
			long min=1000;
			while(a>0)
			{
				if(a%10<min)
				{
					min=a%10;
				}
				a/=10;
			}
			return min;
		}
}