#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int a, b;
    cin >> a >> b;
    int mn = min(a, b);
    int mx = max(a, b);
    if (mx > 2 * mn)
      cout << mx * mx << endl;
    else
      cout << 2 * mn * 2 * mn << endl;
  }
}
