#include <bits/stdc++.h>
using namespace std;
int main() {
  int i, j, k, n, t, a, b, mx, mn, ans;
  cin >> t;
  while (t--) {
    scanf("%d%d", &a, &b);
    mn = min(a, b);
    mx = max(a, b);
    ans = max(mx, mn * 2);
    printf("%d\n", ans * ans);
  }
}
