#include <bits/stdc++.h>
using namespace std;
int main() {
  int T;
  cin >> T;
  while (T--) {
    int a, b;
    cin >> a >> b;
    int a1 = 2 * min(a, b);
    int a2 = max(a, b);
    cout << pow(max(a1, a2), 2) << "\n";
  }
  return 0;
}
