#include <bits/stdc++.h>
using namespace std;
const int mm = 1e6;
long long int d[mm];
int main() {
  long long int n, m, i, j, k, kk, a, b, t, c;
  cin >> t;
  while (t--) {
    cin >> a >> b;
    if (a > b) swap(a, b);
    c = max(a * 2, b);
    cout << c * c << endl;
  }
}
