2. A class has 47 students, and the classroom has 6 rows, with 8 seats in each row. The seat located in the $i$th row and the $j$th column is denoted as $(i, j)$. For the new semester, the seats are to be rearranged. If a student's original seat is $(i, j)$ and the new seat is $(m, n)$, then the student's movement is denoted as $[a, b] = [i-m, j-n]$, and the sum $a+b$ is called the student's position number. The total sum of all students' position numbers is denoted as $S$. Find the difference between the maximum and minimum possible values of $S$.
2. Let the empty seat last semester be $\left(i_{0}, j_{0}\right)$, and the empty seat this semester be $\left(i_{1}, j_{1}\right)$.

Then
$$
\begin{aligned}
S= & {\left[\sum_{i=1}^{6} \sum_{j=1}^{8}(i+j)-\left(i_{0}+j_{0}\right)\right] } \\
& -\left[\sum_{i=1}^{6} \sum_{j=1}^{8}(i+j)-\left(i_{1}+j_{1}\right)\right] \\
= & \left(i_{1}+j_{1}\right)-\left(i_{0}+j_{0}\right) .
\end{aligned}
$$

Therefore, $S_{\max }=(6+8)-(1+1)=12$,
$$
S_{\min }=(1+1)-(6+8)=-12 \text {. }
$$

Thus, the difference between the maximum and minimum values of $S$ is 24.