#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int TEST;
  cin >> TEST;
  while (TEST--) {
    long long a, b;
    cin >> a >> b;
    if (2 * min(a, b) >= max(a, b))
      cout << pow(2 * min(a, b), 2) << "\n";
    else
      cout << pow(max(a, b), 2) << "\n";
  }
  return 0;
}
