n = int(input())
for i in range(n):
    a, b = list(map(int, input().split()))
    if a > b:
        a, b = b, a
    print(max(a * 2, b) * max(a * 2, b))

61869846fb8de4aaff188ead1db9126c6ac4ddd0
<mask token>

<mask token>
for i in range(n):
    a, b = list(map(int, input().split()))
    if a > b:
        a, b = b, a
    print(max(a * 2, b) * max(a * 2, b))

n = int(input())
for i in range(n):
    a, b = list(map(int, input().split()))
    if a > b:
        a, b = b, a
    print(max(a * 2, b) * max(a * 2, b))
