#include <bits/stdc++.h>
using namespace std;
void solve() {
  int a, b;
  cin >> a >> b;
  int x = max(a, b);
  int y = 2 * min(a, b);
  int longer = max(x, y);
  cout << longer * longer << endl;
}
int main() {
  int numTests = 1;
  cin >> numTests;
  while (numTests--) solve();
}
