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