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