#include <bits/stdc++.h>
using namespace std;
void swap(long long *a, long long *b) {
  long long temp = *a;
  *a = *b;
  *b = temp;
}
string mi(string s, string t) {
  if (s.size() > t.size()) {
    return t;
  } else if (s.size() < t.size()) {
    return s;
  } else {
    if (s.compare(t) >= 0) {
      return t;
    } else
      return s;
  }
}
long long isprime(long long n) {
  if (n < 2) return 0;
  if (n < 4) return 1;
  if (n % 2 == 0 or n % 3 == 0) return 0;
  for (long long i = 5; i * i <= n; i += 6)
    if (n % i == 0 or n % (i + 2) == 0) return 0;
  return 1;
}
void pairsort(long long a[], long long b[], long long n) {
  pair<long long, long long> pairt[n];
  for (long long i = 0; i < n; i++) {
    pairt[i].first = a[i];
    pairt[i].second = b[i];
  }
  sort(pairt, pairt + n);
  for (long long i = 0; i < n; i++) {
    a[i] = pairt[i].first;
    b[i] = pairt[i].second;
  }
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long fact(long long a) {
  long long p = 1;
  for (long long i = 1; i <= a; i++) p *= i;
  return p;
}
long long bw(long long a, long long b, long long m) {
  a %= m;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % m;
    a = a * a % m;
    b >>= 1;
  }
  return res;
}
vector<long long> decToBinary(long long n) {
  vector<long long> v;
  for (long long i = 31; i >= 0; i--) {
    long long k = n >> i;
    if (k & 1) v.push_back((long long)pow(2, i));
  }
  return v;
}
long long bs(long long n, long long g, long long b) {
  long long l = 1;
  long long r = n;
  long long x = ceil(n / 2.0);
  long long mid = (l + r) / 2;
  while (l <= r) {
    mid = (l + r) / 2;
    long long d = ceil((mid / 2.0)) * g;
    if (d > x)
      r = mid - 1;
    else if (d < x) {
      l = mid + 1;
    } else
      return mid;
  }
  return mid;
}
long long power(long long x, long long y) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) res = res * x;
    y = y >> 1;
    x = x * x;
  }
  return res;
}
vector<long long> factors(long long x) {
  vector<long long> result;
  long long i = 1;
  while (i * i <= x) {
    if (x % i == 0) {
      result.push_back(i);
      if (x / i != i) {
        result.push_back(x / i);
      }
    }
    i++;
  }
  return result;
}
bool ispalin(string s) {
  long long n = s.size();
  for (long long i = 0; i < n / 2; i++) {
    if (s[i] != s[n - i - 1]) return false;
  }
  return true;
}
void dfs(long long s, bool *visited, vector<vector<long long>> adj) {
  visited[s] = true;
  for (auto i = adj[s].begin(); i != adj[s].end(); i++) {
    if (visited[*i] == false) {
      dfs(*i, visited, adj);
    }
  }
}
void bfs(long long n, long long s, vector<vector<long long>> adj) {
  bool visited[n];
  long long level[n];
  level[0] = 0;
  for (long long i = 0; i < n; i++) visited[i] = false;
  list<long long> q;
  visited[s] = true;
  q.push_back(s);
  while (!q.empty()) {
    s = q.front();
    q.pop_front();
    for (auto i = adj[s].begin(); i != adj[s].end(); i++) {
      if (!visited[*i]) {
        visited[*i] = true;
        level[*i] = level[s] + 1;
        q.push_back(*i);
      }
    }
  }
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long q = 1;
  cin >> q;
  while (q--) {
    long long a, b;
    cin >> a >> b;
    if (a == b) {
      cout << (2 * a) * (2 * a) << "\n";
    } else {
      if (a > b) {
        swap(&a, &b);
      }
      if (2 * a < b) {
        cout << b * b;
      } else {
        cout << 2 * a * 2 * a;
      }
      cout << "\n";
    }
  }
  return 0;
}

### Prompt

Construct a cpp code solution to the problem outlined:

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>

### Response

```cpp
#include <bits/stdc++.h>
using namespace std;
void swap(long long *a, long long *b) {
  long long temp = *a;
  *a = *b;
  *b = temp;
}
string mi(string s, string t) {
  if (s.size() > t.size()) {
    return t;
  } else if (s.size() < t.size()) {
    return s;
  } else {
    if (s.compare(t) >= 0) {
      return t;
    } else
      return s;
  }
}
long long isprime(long long n) {
  if (n < 2) return 0;
  if (n < 4) return 1;
  if (n % 2 == 0 or n % 3 == 0) return 0;
  for (long long i = 5; i * i <= n; i += 6)
    if (n % i == 0 or n % (i + 2) == 0) return 0;
  return 1;
}
void pairsort(long long a[], long long b[], long long n) {
  pair<long long, long long> pairt[n];
  for (long long i = 0; i < n; i++) {
    pairt[i].first = a[i];
    pairt[i].second = b[i];
  }
  sort(pairt, pairt + n);
  for (long long i = 0; i < n; i++) {
    a[i] = pairt[i].first;
    b[i] = pairt[i].second;
  }
}
long long gcd(long long a, long long b) {
  if (b == 0) return a;
  return gcd(b, a % b);
}
long long fact(long long a) {
  long long p = 1;
  for (long long i = 1; i <= a; i++) p *= i;
  return p;
}
long long bw(long long a, long long b, long long m) {
  a %= m;
  long long res = 1;
  while (b > 0) {
    if (b & 1) res = res * a % m;
    a = a * a % m;
    b >>= 1;
  }
  return res;
}
vector<long long> decToBinary(long long n) {
  vector<long long> v;
  for (long long i = 31; i >= 0; i--) {
    long long k = n >> i;
    if (k & 1) v.push_back((long long)pow(2, i));
  }
  return v;
}
long long bs(long long n, long long g, long long b) {
  long long l = 1;
  long long r = n;
  long long x = ceil(n / 2.0);
  long long mid = (l + r) / 2;
  while (l <= r) {
    mid = (l + r) / 2;
    long long d = ceil((mid / 2.0)) * g;
    if (d > x)
      r = mid - 1;
    else if (d < x) {
      l = mid + 1;
    } else
      return mid;
  }
  return mid;
}
long long power(long long x, long long y) {
  long long res = 1;
  while (y > 0) {
    if (y & 1) res = res * x;
    y = y >> 1;
    x = x * x;
  }
  return res;
}
vector<long long> factors(long long x) {
  vector<long long> result;
  long long i = 1;
  while (i * i <= x) {
    if (x % i == 0) {
      result.push_back(i);
      if (x / i != i) {
        result.push_back(x / i);
      }
    }
    i++;
  }
  return result;
}
bool ispalin(string s) {
  long long n = s.size();
  for (long long i = 0; i < n / 2; i++) {
    if (s[i] != s[n - i - 1]) return false;
  }
  return true;
}
void dfs(long long s, bool *visited, vector<vector<long long>> adj) {
  visited[s] = true;
  for (auto i = adj[s].begin(); i != adj[s].end(); i++) {
    if (visited[*i] == false) {
      dfs(*i, visited, adj);
    }
  }
}
void bfs(long long n, long long s, vector<vector<long long>> adj) {
  bool visited[n];
  long long level[n];
  level[0] = 0;
  for (long long i = 0; i < n; i++) visited[i] = false;
  list<long long> q;
  visited[s] = true;
  q.push_back(s);
  while (!q.empty()) {
    s = q.front();
    q.pop_front();
    for (auto i = adj[s].begin(); i != adj[s].end(); i++) {
      if (!visited[*i]) {
        visited[*i] = true;
        level[*i] = level[s] + 1;
        q.push_back(*i);
      }
    }
  }
}
int32_t main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long q = 1;
  cin >> q;
  while (q--) {
    long long a, b;
    cin >> a >> b;
    if (a == b) {
      cout << (2 * a) * (2 * a) << "\n";
    } else {
      if (a > b) {
        swap(&a, &b);
      }
      if (2 * a < b) {
        cout << b * b;
      } else {
        cout << 2 * a * 2 * a;
      }
      cout << "\n";
    }
  }
  return 0;
}

```