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