N=int(input()) X=[-1]*N for i in range(N): p=int(input()) X[i]=(p-1)**2 print(*X,sep="\n")