#include <bits/stdc++.h>
using namespace std;
void solve() {
  int a, b;
  cin >> a >> b;
  if (min(a, b) * 2 >= max(a, b)) {
    cout << (2 * min(a, b)) * (2 * min(a, b)) << endl;
  } else {
    cout << ((max(a, b) * (max(a, b)))) << endl;
  }
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int t = 1;
  cin >> t;
  while (t--) solve();
}
