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