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