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