#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t) {
    int a, b;
    cin >> a >> b;
    int c, d;
    c = min(a, b);
    d = max(a, b);
    if (2 * c >= d) {
      cout << pow(2 * c, 2) << "\n";
    } else {
      cout << pow(d, 2) << "\n";
    }
    t--;
  }
}
