#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int a, b;
    cin >> a >> b;
    int x = 2 * a;
    int y = 2 * b;
    if (x > y) {
      if (a > y)
        cout << a * a << endl;
      else
        cout << y * y << endl;
    } else {
      if (b > x)
        cout << b * b << endl;
      else
        cout << x * x << endl;
    }
  }
  return 0;
}
