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