#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int t;
  cin >> t;
  while (t--) {
    long long int a, b;
    cin >> a >> b;
    long long int x = max(min(a, b) * 2, max(a, b));
    cout << x * x << "\n";
  }
  return 0;
}
