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