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>
#qn given an arr of size n for every  i position find a min j such that j>i and arr[j]>arr[i]
#it prints the position of the nearest .
import sys
input = sys.stdin.readline
 #qn given an arr of size n for every  i position find a min j such that j>i and arr[j]>arr[i]
#it prints the position of the nearest .
# import sys
import heapq 
import copy
import math
import decimal
from decimal import *
#heapq.heapify(li) 
#
#heapq.heappush(li,4) 
#
#heapq.heappop(li)
#
# &	Bitwise AND Operator	10 & 7 = 2
# |	Bitwise OR Operator	10 | 7 = 15
# ^	Bitwise XOR Operator	10 ^ 7 = 13
 
# <<	Bitwise Left Shift operator	10<<2 = 40
# >>	Bitwise Right Shift Operator
# '''############ ---- Input Functions ---- #######Start#####'''

 
class Node:
    def _init_(self,val):
        self.data = val
        self.left = None
        self.right = None
##to initialize wire : object_name= node(val)##to create a new node
## can also be used to create linked list
class fen_tree:
    """Implementation of a Binary Indexed Tree (Fennwick Tree)"""
    
    #def __init__(self, list):
    #    """Initialize BIT with list in O(n*log(n))"""
    #    self.array = [0] * (len(list) + 1)
    #    for idx, val in enumerate(list):
    #        self.update(idx, val)
 
    def __init__(self, list):
        """"Initialize BIT with list in O(n)"""
        self.array = [0] + list
        for idx in range(1, len(self.array)):
            idx2 = idx + (idx & -idx)
            if idx2 < len(self.array):
                self.array[idx2] += self.array[idx]
 
    def prefix_query(self, idx):
        """Computes prefix sum of up to including the idx-th element"""
        # idx += 1
        result = 0
        while idx:
            result += self.array[idx]
            idx -= idx & -idx
        return result
    def prints(self):
        print(self.array)
        return
        # for i in self.array:
        #     print(i,end = " ")
        # return 
    def range_query(self, from_idx, to_idx):
        """Computes the range sum between two indices (both inclusive)"""
        return self.prefix_query(to_idx) - self.prefix_query(from_idx - 1)
 
    def update(self, idx, add):
        """Add a value to the idx-th element"""
        # idx += 1
        while idx < len(self.array):
            self.array[idx] += add
            idx += idx & -idx
 
 
def pre_sum(arr):
	#"""returns the prefix sum inclusive ie ith position in ans  represent sum from 0 to ith position"""
	p = [0]
	for i in arr:
		p.append(p[-1] + i)
	p.pop(0)
	return p
 
def pre_back(arr):
	#"""returns the prefix sum inclusive ie ith position in ans  represent sum from 0 to ith position"""
	p = [0]
	for i in arr:
		p.append(p[-1] + i)
	p.pop(0)
	return p
def bin_search(arr,l,r,val):#strickly greater
	if arr[r] <= val:
		return r+1	
	if r-l < 2:
		if arr[l]>val:
			return l
		else:
			return r
	mid = int((l+r)/2)
	if arr[mid] <= val:
		return bin_search(arr,mid,r,val)
	else:
		return bin_search(arr,l,mid,val)
def search_leftmost(arr,val):
	def helper(arr,l,r,val):
		# print(arr)
		print(l,r)
		if arr[l] == val:
			return l
		if r -l <=1:
			if arr[r] == val:
				return r
			else:
				print("not found")
				return
		mid = int((r+l)/2)
		if arr[mid] >= val:
			return helper(arr,l,mid,val)
		else:
			return helper(arr,mid,r,val)
	return helper(arr,0,len(arr)-1,val)
def search_rightmost(arr,val):
	def helper(arr,l,r,val):
		# print(arr)
		print(l,r)
		if arr[r] == val:
			return r
		if r -l <=1:
			if arr[l] == val:
				return r
			else:
				print("not found")
				return
		mid = int((r+l)/2)
		if arr[mid] > val:
			return helper(arr,l,mid,val)
		else:
			return helper(arr,mid,r,val)
	return helper(arr,0,len(arr)-1,val)
def preorder_postorder(root,paths,parent,left,level):
	# if len(paths[node]) ==1 and node !=1 :
	# 	return [parent,left,level]
	l = 0
	queue = [root]
	while(queue!=[]):
		node = queue[-1]
		# print(queue,node)
		flag = 0
		for i in paths[node]:
			if i!=parent[node] and level[i]== sys.maxsize:
				parent[i] = node
				level[i] = level[node]+1
				flag = 1
				queue.append(i)
		if flag == 0:
			left[parent[node]] +=(1+left[node])
			queue.pop()
	# 		[parent,left,level] = helper(i,paths,parent,left,level)
	# 		l = left[i] + l +1
	# left[node] = l
	return [parent,left,level]
def nCr(n, r, p): 
    # initialize numerator 
    # and denominator 
	if r == 0:
		return 1
	num = den = 1 
	for i in range(r): 
		num = (num * (n - i)) % p 
		den = (den * (i + 1)) % p 
	return (num * pow(den,p - 2, p)) % p 
def inp():
	return(int(input()))
def inlt(): 
	return(list(map(int,input().split())))
def insr():
	s = input()
	return(list(s[:len(s) - 1]))
def invr():
	return(map(int,input().split()))
 ############ ---- Input Functions ---- #######End
 # #####   
def pr_list(a):
	print(*a, sep=" ")
def main():
	tests =  inp()
	# tests = 1
	# mod = 1000000007
	mod = 998244353
	limit = 10**18
	# nCrModp(1332,42,mod)
	# return
	for test in range(tests):
		[a,b] = inlt()
		side = min(max(2*a,b),max(a,2*b), a+b )
		print(side*side)






		# print(ans)
		# a = 499979
		
		# print(Decimal(a*h + (a-1) *c)/Decimal(2*a - 1),(a*h + (a-1) *c)/(2*a - 1))
		# a = 499981
		# print(Decimal(a*h + (a-1) *c)/Decimal(2*a - 1),(a*h + (a-1) *c)/(2*a - 1))
		
 
if __name__== "__main__":
	main()