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.io.BufferedReader;
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.*;



/**
 * Use pen and paper. Solve on paper then code.
 * If there is some reasoning e.g. sequence/paths, try printing first 100 elements or 100 answers using brute and observe.
 * Read question with extreme caution. Sometimes we make question complex due to misunderstanding.
 * Prefix sum and suffix sum is highly usable concept, look for it.
 * Think of cleanest approach. If too many if else are coming then its indication of WA.
 * https://codeforces.com/contest/1354/submission/80639237
 */
public class Codeforces {

	public static void main(String args[]) throws IOException {
		Reader in = new Reader();
//		Scanner in = new Scanner(System.in);
		int t = in.nextInt();
		while (t-->0) {
			first(in);
//			third(in);
//			fifth(in);
		}
		in.close();
	}

	private static void first(Reader in) throws IOException {
		int a = in.nextInt(), b = in.nextInt();
		if (a == b) {
			System.out.println(4*a*a);
			return;
		}
		if (a<b) {
			int tp = a;
			a = b;
			b = tp;
		}
		if (a/2>=b) {
			System.out.println(a*a);
			return;
		}
		b = 2*b;
		System.out.println(b*b);
	}

	private static void fifth(Scanner in) {
		int n = in.nextInt(), m = in.nextInt();
		String s[] = new String[n];
		for (int i=0;i<n;i++) s[i] = in.next();			
		
		char c[] = new char[m];
		for (int i=0;i<m;i++) {
			int d[] = new int[256];
			Arrays.fill(d, 0);
			for (int j=0;j<n;j++) {
				d[s[j].charAt(i)]++;
			}
			int max = -1, ind = -1;
			for (int k=0;k<d.length;k++) {
				if (d[k]>max) {
					max = d[k];
					ind = k;
				}
			}
			c[i] = (char) ind;
		}
		
		for (int i=0;i<n;i++) {
			if (check(s[i], c, n) > 1) {
				System.out.println(-1);
				break;
			}
			if (i == n-1) {
				System.out.println(c);
			}
		}
	}
	
	private static int check(String s, char[] c, int n) {
		int cnt = 0;
		for (int i=0;i<s.length();i++) {
			if (s.charAt(i) != c[i]) cnt++;
		}
		return cnt;
	}

	private static void dfs(int[][] a, int i, int j, int n, Set<Pair> set) {
		if (invalid) return;
		if (i<0 || i>=n) return;
		if (j<0 || j>=n) return;
		Pair pr = new Pair(i, j);
		if (set.contains(pr)) return;
		if (i == n-1 && j == n-1) {
			set.add(pr);
			return;
		}
		
		if (a[i][j] == 1) {
			boolean isValid = false;
			if (i < n-1 && a[i+1][j] == 1) {
				isValid = true;
			}
			if (j<n-1 && a[i][j+1] == 1) {
				isValid = true;
			}
			if (j == n-1 || i == n-1) {
				isValid = true;
			}
			if (!isValid) {
				invalid = true;
				return;
			}
		}
		set.add(pr);
		dfs(a,i+1,j,n,set);
		dfs(a,i,j+1,n,set);
	}

	static boolean invalid = false;
	static class Pair {
		Integer x;
		Integer y;
		private Pair(int x, int y) {
			this.x = x;
			this.y = y;
		}
		
		@Override
		public boolean equals(Object o) {
			if (o == null || !(o instanceof Pair))
				return false;
			Pair cor = (Pair)o;
			return x.equals(cor.x) && y.equals(cor.y);
		}
		
		@Override
		public int hashCode() {
			int result = 17;
			result = result + 31*x;
			result = result + 31*y;
			return result;
		}
		
		static class PairComparatorX implements Comparator<Pair> {

			@Override
			public int compare(Pair o1, Pair o2) {
				return o1.x.compareTo(o2.x);
			}
			
		}

		static class PairComparatorY implements Comparator<Pair> {

			@Override
			public int compare(Pair o1, Pair o2) {
				return o1.y.compareTo(o2.y);
			}
			
		}

	}
	
	private static void third(Reader in) throws IOException {
		int n = in.nextInt();
		int a[] = new int[n];
		int odd = 0;
		for (int i=0;i<n;i++) {
			a[i] = in.nextInt();
			if (a[i]%2 != 0) odd++;
		}
		if (odd == n/2) {
			System.out.println();
		}
		Arrays.parallelSort(a);
		
		for (int i=0;i<n;i++) {
			
		}
	}


	static class Reader 
    { 
        final private int BUFFER_SIZE = 1 << 16; 
        private DataInputStream din; 
        private byte[] buffer; 
        private int bufferPointer, bytesRead;
        StringTokenizer st;
        BufferedReader br;
  
        public Reader() 
        { 
            din = new DataInputStream(System.in); 
            buffer = new byte[BUFFER_SIZE]; 
            bufferPointer = bytesRead = 0; 
            br = new BufferedReader(new InputStreamReader(System.in));
        } 
  
        public Reader(String file_name) throws IOException 
        { 
            din = new DataInputStream(new FileInputStream(file_name)); 
            buffer = new byte[BUFFER_SIZE]; 
            bufferPointer = bytesRead = 0; 
        } 
  
        public String readLine() throws IOException 
        { 
            byte[] buf = new byte[64]; // line length 
            int cnt = 0, c; 
            while ((c = read()) != -1) 
            { 
                if (c == '\n') 
                    break; 
                buf[cnt++] = (byte) c; 
            } 
            return new String(buf, 0, cnt); 
        } 
  
        public int nextInt() throws IOException 
        { 
            int ret = 0; 
            byte c = read(); 
            while (c <= ' ') 
                c = read(); 
            boolean neg = (c == '-'); 
            if (neg) 
                c = read(); 
            do
            { 
                ret = ret * 10 + c - '0'; 
            }  while ((c = read()) >= '0' && c <= '9'); 
  
            if (neg) 
                return -ret; 
            return ret; 
        } 
  
        public long nextLong() throws IOException 
        { 
            long ret = 0; 
            byte c = read(); 
            while (c <= ' ') 
                c = read(); 
            boolean neg = (c == '-'); 
            if (neg) 
                c = read(); 
            do { 
                ret = ret * 10 + c - '0'; 
            } 
            while ((c = read()) >= '0' && c <= '9'); 
            if (neg) 
                return -ret; 
            return ret; 
        } 
  
        public double nextDouble() throws IOException 
        { 
            double ret = 0, div = 1; 
            byte c = read(); 
            while (c <= ' ') 
                c = read(); 
            boolean neg = (c == '-'); 
            if (neg) 
                c = read(); 
  
            do { 
                ret = ret * 10 + c - '0'; 
            } 
            while ((c = read()) >= '0' && c <= '9'); 
  
            if (c == '.') 
            { 
                while ((c = read()) >= '0' && c <= '9') 
                { 
                    ret += (c - '0') / (div *= 10); 
                } 
            } 
  
            if (neg) 
                return -ret; 
            return ret; 
        } 
  
        private void fillBuffer() throws IOException 
        { 
            bytesRead = din.read(buffer, bufferPointer = 0, BUFFER_SIZE); 
            if (bytesRead == -1) 
                buffer[0] = -1; 
        } 
  
        private byte read() throws IOException 
        { 
            if (bufferPointer == bytesRead) 
                fillBuffer(); 
            return buffer[bufferPointer++]; 
        } 
  
        public void close() throws IOException 
        { 
            if (din == null) 
                return; 
            din.close(); 
        } 
        
		String next() {
			while (st == null || !st.hasMoreElements()) {
				try {
					st = new StringTokenizer(br.readLine());
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
			return st.nextToken();
		}

    } 
		
}