#include <bits/stdc++.h>
int main() {
  int tc, i;
  scanf("%d", &tc);
  while (tc--) {
    int max, min, a, b;
    scanf("%d%d", &a, &b);
    if (a > b) {
      max = a;
      min = b;
    } else {
      max = b;
      min = a;
    }
    if (max >= min * 2)
      printf("%d\n", max * max);
    else
      printf("%d\n", 4 * min * min);
  }
  return 0;
}
