#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 r1 = min(a, b) * 2;
    long long r2 = max(a, b);
    if (r1 > r2) {
      cout << r1 * r1 << endl;
    } else {
      cout << r2 * r2 << endl;
    }
  }
}
