8. Fill $n^{2}(n \geqslant 3)$ integers into an $n \times n$ grid, with one number per cell, such that the product of the numbers in each row and each column is 30. Then there are $\qquad$ ways to fill the grid.
8. $2^{(n-1)^{2}}(n!)^{3}$.

First, prove two lemmas.
Lemma 1 In an $n \times n$ grid, fill each cell with 1 or -1, such that the product of the numbers in each row and each column is 1. There are $2^{(n-1)^{2}}$ ways to fill the grid.

Proof of Lemma 1 The first $n-1$ columns of the first row, each cell has 2 ways to be filled. By the multiplication principle, there are $2^{n-1}$ ways to fill this row, and it is easy to see that the last cell in this row is determined.

The 2nd to the $n-1$th rows are exactly the same as the first row, each row has $2^{n-1}$ ways to be filled.

The first $n-1$ columns of the $n$th row are determined by the first $n-1$ rows of the same column, and the last cell in the $n$th row is also determined. Therefore, there are
$$
\underbrace{2^{n-1} \cdot 2^{n-1} \cdots \cdot 2^{n-1}}_{n-1 \uparrow}=2^{(n-1)^{2}}
$$
ways to fill the grid.
Lemma 2 In each cell, fill in 2, 3, 5 (allowing different numbers in the same cell), such that each of the numbers 2, 3, 5 appears exactly once in each row and each column, and the product of the numbers in each row and each column is 30.

Proof of Lemma 2 There are $n!$ ways to fill in 2 such that each row and each column contains exactly one 2. Similarly, there are $n!$ ways to fill in 3 and 5. By the multiplication principle, there are $n! \cdot n! \cdot n! = (n!)^{3}$ ways to fill in 2, 3, and 5.
Lemmas 1 and 2 are proved.
First, fill in 2, 3, 5 in the grid, then fill in 1 or -1 in each cell. If a cell does not contain 2, 3, or 5, fill it directly with 1 or -1; if a cell contains one of the numbers 2, 3, or 5, multiply the number in the cell by 1 or -1. Therefore, there are $2^{(n-1)^{2}}(n!)^{3}$ ways to fill the grid.