#include <bits/stdc++.h>
using namespace std;
int main() {
  int t;
  cin >> t;
  while (t--) {
    int a, b;
    cin >> a >> b;
    int m, n;
    m = min(a, b);
    n = max(a, b);
    int ans = max(m * 2, n);
    cout << ans * ans << endl;
  }
}
