#include <bits/stdc++.h>
using namespace std;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL), cout.tie(NULL);
  int t;
  cin >> t;
  while (t--) {
    int a, b, x, y;
    cin >> a >> b;
    x = max(a, b);
    y = min(a, b);
    int p = max(x, 2 * y);
    cout << p * p << endl;
  }
  return 0;
}
