#include <bits/stdc++.h>
using namespace std;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
void y_k() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}
int32_t main() {
  y_k();
  long long t;
  cin >> t;
  while (t--) {
    long long a, b;
    cin >> a >> b;
    long long mx = max(a, b);
    long long sm = min(a, b);
    if (mx <= (sm * 2)) {
      cout << (sm * 2) * (sm * 2) << "\n";
    } else {
      cout << (mx * mx) << "\n";
    }
  }
  return 0;
}
