[ print(pow(x - 1, 2)) if x != 2 else print(2) for x in map(int, open(0).read().split())[1:] ]