Find all possible integer values of n such that the following system of equations has a solution for z:
z^n = 1
(z + i)^n = 1