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