Why prime avoidance lemma allows only at most 2 non-prime ideals?
The following is the last part of the proof taken from wikipedia:
For the case $n > 2$, choose $z_i \in E \cap (I_i - \cup_{j \ne i} I_j), \, \, 1 \le i \le n$ and then put $z = z_1 \cdots z_{n-1} + z_n.$ Then z is in E but not in any of $I_i$'s. Indeed, if z is in $I_i$ for some $i \le n - 1$, then $z_n$ is in $I_i$, a contradiction. If z is in $I_n$, then $z_1 \dots z_{n-1}$ is in $I_n$ and, since $I_n$ is a prime ideal, $z_i$ is in $I_n$, a contradiction. (Note, after the initial reduction, we only need the fact that $I_n$ is a prime ideal.)
From what I see, as long as one of them is prime, say $I_n$. What am I misunderstanding here? The part on z in $I_i$ does not need $I_i$ to be prime, does it? I think it just need $I_i$ to be ideal.