#include <bits/stdc++.h>
using namespace std;
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long t;
  cin >> t;
  while (t--) {
    long long a, b;
    cin >> a >> b;
    long long m = max(a, b), n = min(a, b);
    cout << max(4 * n * n, (m) * (m)) << endl;
    ;
  }
}
