#include using namespace std; typedef long long ll; int main() { int N; cin >> N; ll p[N]; for (int i = 0; i < N; i++) { cin >> p[i]; } for (int i = 0; i < N; i++) { if (p[i] == 2) { cout << 2 << "\n"; } else { ll t = p[i] - 1; cout << t * t << "\n"; } } return 0; }