#include using namespace std; int main() { int N; cin >> N; while(N--) { long long p; cin >> p; if(p == 2) cout << p << endl; else cout << (p-1)*(p-1) << endl; } }