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