#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int a, b, x1;
    cin >> a >> b;
    x1 = min(max(2 * a, b), max(a, 2 * b));
    cout << x1 * x1 << endl;
  }
}
