28 Given an $n \times n$ grid $(n \geqslant 2)$, fill it with -1 and +1. The cell at the intersection of the $i$-th row and the $j$-th column is called $(i, j)$, and $(i-1, j),(i+1, j)(i, j-1)(i, j+1)$ are called the neighbors of $(i, j)$. Here, the addition and subtraction are performed modulo $n$. A single operation is defined as replacing the number in each cell $(i, j)$ with the product of its four neighbors. Find all $n$ such that for any $n \times n$ grid, a finite number of operations can make all numbers in the grid +1.
Solve for all $n$ where $n=2^{k}\left(k \in\{0\} \cup \mathbf{Z}^{+}\right)$.
First, we prove that $n=2^{k}\left(k \in\{0\} \cup \mathbf{Z}^{+}\right)$ satisfies the condition.
When $k=0$, the proposition is obviously true;

When $k \geqslant 1$, since $(-1)^{2}=1$, if a number in a cell appears an even number of times in the operation, it can be ignored.

Next, we consider the situation after each change when $n=2^{k}$: Suppose the number in the $(i, j)$-th cell at the beginning is $x(i, j)$, and define $x_{k}(i, j)$ as the number in the $(i, j)$-th cell after $k$ transformations. Then after one transformation,
$$
x_{1}(i, j)=x(i-1, j) x(i+1, j) x(i, j-1) x(i, j+1),
$$

After two transformations,
$$
\begin{aligned}
x_{2}(i, j)= & x_{1}(i-1, j) x_{1}(i+1, j) x_{1}(i, j-1) x_{1}(i, j+1) \\
= & x(i-2, j) x(i, j) x(i-1, j-1) x(i-1, j+1) \\
& \cdot x(i, j) x(i+2, j) x(i+1, j-1) x(i+1, j+1) \\
& \cdot x(i-1, j-1) x(i+1, j-1) x(i, j-2) x(i, j) \\
& \cdot x(i-1, j+1) x(i+1, j+1) x(i, j) x(i, j+2) \\
& x^{4}(i, j) x^{2}(i-1, j-1) x^{2}(i-1, j+1) x^{2} \\
& (i+1, j-1) x^{2}(i+1, j+1) \\
= & x(i, j-2) x(i, j+2) x(i-2, j) x(i+2, j),
\end{aligned}
$$

So
$$
x_{2}(i, j)=x(i, j-2) x(i, j+2) x(i-2, j) x(i+2, j) .
$$

Similarly, it is easy to prove by mathematical induction that
$$
x_{s}(i, j)=x\left(i, j-2^{s}\right) x\left(i, j+2^{s}\right) x\left(i-2^{s}, j\right) x\left(i+2^{s}, j\right) \text {, }
$$

In particular, taking $s=k-1$, we have
$$
\begin{aligned}
x_{k-1}(i, j)= & x\left(i, j-2^{k-1}\right) x\left(i, j+2^{k-1}\right) \\
& x\left(i-2^{k-1}, j\right) x\left(i+2^{k-1}, j\right) .
\end{aligned}
$$

Since
$$
\left(i+2^{k-1}\right)-\left(i-2^{k-1}\right)=2^{k} \equiv 0\left(\bmod 2^{k}\right),
$$

Thus
$$
x\left(i+2^{k-1}, j\right)=x\left(i-2^{k-1}, j\right) .
$$

Similarly, $x\left(i, j+2^{k-1}\right)=x\left(i, j-2^{k-1}\right)$.
Therefore, $x_{k}(i, j)=x^{2}\left(i-2^{k-1}, j\right) \cdot x^{2}\left(i, j-2^{k-1}\right)=1$.
So after $k-1$ transformations, all the numbers in the cells are 1, i.e., $n=2^{k}$ satisfies the condition.
Next, we prove that when $n \neq 2^{k}$, there must exist a way to fill the grid such that it cannot be transformed into all 1s.
First, consider the case of odd numbers, let $n=2 k+1\left(k \in \mathbf{Z}^{+}\right)$, we construct a row

Then these $2 k+1$ rows are all the above arrangement, at this point we only need to discuss the change in one row.
Since each row is the same, for $\forall(i, j), x(i-1, j)=x(i+1, j)$, so each transformation of $x(i, j)$ only depends on $x(i, j-1)$ and $x(i, j+1)$. The problem is reduced to the row “ $\overbrace{-1,-1, \cdots,-1}^{k \uparrow}, 1, \overbrace{-1,-1, \cdots,-1}^{k}$ ”, each operation changes the $i$-th cell to the product of the $i+1$-th and $i-1$-th cells (under modulo $n$), we need to prove that no matter how many operations are performed, it cannot all become +1.

Assume by contradiction that there exists a $t$ such that after $t$ operations, this row becomes all 1s, and let $t$ be the smallest, then $t \geqslant 2$, and after $t-1$ operations, there must be a -1, without loss of generality, assume it is the 1st position, then by the definition of the transformation, the 3rd, 5th, ..., $2 k+1$-th positions are all -1, the $2 k+1$-th position is -1 and the 1st position after transformation is 1, so the 2nd position is -1, this way we can get the 4th, 6th, ..., $2 k$-th positions are all -1, i.e., after $t-1$ operations, it becomes all -1.

This means that after $t-2$ operations, every two adjacent positions in this row are different, without loss of generality, assume the 1st position is 1, the 2nd position is -1, the 3rd position is 1, ..., the $2 k$-th position is -1, the $2 k+1$-th position is 1, at this time the $2 k+1$-th position is the same as the 1st position, contradiction!

Therefore, the assumption is false, i.e., this row cannot all become 1 no matter how it is operated, so when $n=2 k+1\left(k \in \mathbf{Z}^{+}\right)$, it does not satisfy the condition.

For $n \neq 2^{k}$ and $n$ is even, then there must be $n=2^{s} \cdot t$ ( $t$ is an odd number greater than 1). At this time, the row when $n=t$ is repeated $2^{s}$ times, then this row cannot all become 1, this way we have proved that $n \neq 2^{k}$ does not satisfy the condition.
In summary, all $n$ are $n=2^{k}\left(k \in\{0\} \cup \mathbf{Z}^{+}\right)$.