#include <bits/stdc++.h>
using namespace std;
void solve() {
  int x, y;
  cin >> x >> y;
  cout << pow(min(max(2 * x, y), max(2 * y, x)), 2) << "\n";
}
int32_t main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    solve();
  }
  return 0;
}
