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