n=int(input()) x=[] for i in range(n): x.append(int(input())) for p in x: print((p-1)**2+1)