#include using namespace std; using ll = long long; ll solve() { ll P; cin >> P; return P == 2 ? 2 : (P - 1) * (P - 1); } int main() { ios::sync_with_stdio(false); cin.tie(nullptr); ll t; cin >> t; while(t--) { cout << solve() << "\n"; } }