#include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include #include //cout << fixed << setprecision(15) << << endl; #include //#include "atcoder/all" using namespace std; //using namespace atcoder; typedef long long ll; #define pb push_back #define rep(i,n) for(int i=0;i<(n);i++) #define REP(i,n) for(int i=1;i<=(n);i++) #define P pair int mx8[] = {0,0,1,-1,-1,1,-1,1}; int my8[] = {-1,1,0,0,-1,-1,1,1}; int mx4[] = {1,-1,0,0}; int my4[] = {0,0,-1,1}; ll mod = 1000000007; template class SegTree{ public: vector dat; int N = 1; ll INF = (1ll<<31); public: SegTree(vector v) { int sz = v.size(); while(N < sz) N *= 2; dat.resize(2*N-1); for(int i = 0; i < sz; ++i) dat[N-1+i] = v[i]; for(int i = N-2; i >= 0; --i) dat[i] = min(dat[i*2+1], dat[i*2+2]); } void update(int i, T x) { i += N - 1; dat[i] = x; while(i > 0) { i = (i - 1) / 2; dat[i] = min(dat[2*i+1], dat[2*i+2]); } } //最初はquery(a,b,0,0,N)を呼び出す T query(int a, int b, int k, int l, int r){ if(r <= a || b <= l) return INF; else if(a <= l && r <= b) return dat[k]; else { T c1 = query(a, b, 2*k+1, l, (r+l)/2); T c2 = query(a, b, 2*k+2, (r+l)/2, r); return min(c1, c2); } } }; int main(){ ios::sync_with_stdio(false); int n; cin >> n; while(n--){ ll p; cin >> p; if(p!=2){ cout << (p-1)*(p-1) << endl; }else{ cout << 2 << endl; } } }