#include <bits/stdc++.h>
using namespace std;
void make_fast() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
}
int main() {
  make_fast();
  int t = 1;
  cin >> t;
  while (t--) {
    long long int i = 0, n = 0, s = 0, j = 2, q = 0, sum = 0, prev = 0,
                  start = 0, end = 0, m = 0, x = 1, y = 0, z = 0, count = 0,
                  mini = INT_MAX, avg = 0, a = 0, b = 0, c = 0, d = 0, e = 0,
                  k = 0, maxi = 0, ans = 0;
    cin >> a >> b;
    c = min(a, b);
    c = 2 * c;
    cout << max(c, max(a, b)) * max(c, max(a, b)) << endl;
    ;
  }
}
