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