8. There are 9 students participating in a math competition in the same classroom, with seats arranged in 3 rows and 3 columns, represented by a $3 \times 3$ grid, where each cell represents a seat. To prevent cheating, three types of exams, $A$, $B$, and $C$, are used, and it is required that any two adjacent seats (cells sharing a common edge) receive different types of exams. The number of ways to distribute the exams that meet the conditions is $\qquad$ kinds.
8. 246.

Let $a_{ij}$ denote the square at the $i$-th row and $j$-th column. First, consider the number of ways to distribute type $A$ papers at $a_{22}$.
$$
\begin{array}{l}
\text { Let } M=\left\{a_{12}, a_{21}, a_{32}, a_{23}\right\}, \\
N=\left\{a_{11}, a_{31}, a_{33}, a_{13}\right\} .
\end{array}
$$

Consider the types of papers on the squares in $M$. There are several scenarios:
(1) All are type $B$ papers. In this case, there is a unique way to distribute the papers in $M$, and each square in $N$ has 2 ways to distribute the papers, resulting in $2^4 = 16$ ways.
(2) All are type $C$ papers. Similarly to (1), there are $2^4 = 16$ ways.
(3) One square is a type $B$ paper, and the other three are type $C$ papers (as shown in Figure 2). In this case, there are 4 ways to choose one square in $M$ to place the type $B$ paper, and the other squares in $M$ have a unique distribution method. Each square in $N$ has $1 \times 1 \times 2 \times 2 = 4$ ways to distribute the papers, resulting in $4 \times 4 = 16$ ways.
(4) One square is a type $C$ paper, and the other three are type $B$ papers. Similarly to (3), there are $4 \times 4 = 16$ ways.
(5) Two squares are type $B$ papers, and the other two are type $C$ papers. In this case, if the two squares with type $B$ papers are in the same row (or column) (as shown in Figure 3(a)), there are 2 ways to choose the squares in $M$ to place the type $B$ papers, and the other squares in $M$ have a unique distribution method. Each square in $N$ has a unique distribution method, resulting in 2 ways. If the two squares with type $B$ papers are in different rows and columns (as shown in Figure 3(b)), there are 4 ways to choose the squares in $M$ to place the type $B$ papers, and the other squares in $M$ have a unique distribution method. Each square in $N$ has $2 \times 2 \times 1 \times 1 = 4$ ways to distribute the papers, resulting in $4 \times 4 = 16$ ways. Thus, in this scenario, there are $2 + 16 = 18$ ways.

By symmetry, the total number of ways to distribute the papers that meet the requirements is $3(4 \times 16 + 18) = 246$ ways.