#include <bits/stdc++.h>
using namespace std;
void solve() {
  long long l, b;
  cin >> l >> b;
  if (b > l) {
    long long temp = l;
    l = b;
    b = temp;
  }
  long long x = max(l, 2 * b);
  cout << x * x << "\n";
}
signed main() {
  std::ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  long long t;
  t = 1;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
