#include <bits/stdc++.h>
using namespace std;
int findmin(int a, int b) {
  if (a <= b) {
    int edge = a + a;
    if (edge < b) return b;
    return edge;
  } else {
    int edge = b + b;
    if (edge < a) return a;
    return edge;
  }
}
int main() {
  int t, a, b, x;
  int i;
  cin >> t;
  int arr[2 * t];
  cout << "\n";
  for (i = 0; i < t; i++) {
    cin >> a;
    arr[2 * i] = a;
    cin >> b;
    arr[2 * i + 1] = b;
  }
  for (i = 0; i < t; i++) {
    x = findmin(arr[2 * i], arr[2 * i + 1]);
    cout << x * x << "\n";
  }
  return 0;
}
