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