#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  scanf("%d", &t);
  while (t--) {
    int a, b;
    scanf("%d %d", &a, &b);
    if (a <= b)
      printf("%d\n", max(4 * a * a, b * b));
    else
      printf("%d\n", max(a * a, 4 * b * b));
  }
}
