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