#include <bits/stdc++.h>
using namespace std;
void solve() {
  int a, b;
  cin >> a >> b;
  int ans = min(a, b) * 2;
  if (ans < max(a, b)) ans = max(a, b);
  cout << ans * ans << "\n";
}
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    solve();
  }
  return 0;
}
