#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  int TC;
  cin >> TC;
  while (TC--) {
    int A, B;
    cin >> A >> B;
    int Total_side_01 = (min(A, B) * 2);
    cout << pow(max(Total_side_01, max(A, B)), 2) << "\n";
  }
  return 0;
}
