#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  int t;
  cin >> t;
  while (t--) {
    long long a, b;
    cin >> a >> b;
    long long max, min;
    if (a > b) {
      min = b;
      max = a;
    } else {
      min = a;
      max = b;
    }
    if (2 * min > max) {
      cout << min * min * 4 << "\n";
    } else {
      cout << max * max << "\n";
    }
  }
  return 0;
}
