174. Let us agree to denote the number at the intersection of the $i$-th row and $j$-th column of the table by $a_{ij}$; in this case $a_{ij} = 1, \ldots, n^2$, where $i, j = 1, \ldots, n$. Let now $1 = a_{ji}$; then according to the problem's condition, $2 = a_{j_2 j_2}, \quad 3 = a_{j_3 j_4}$, and so on, up to $n^2 = a_{j_{n^2} j_{n^2}+1}$. Of course, the numbers $l_1, \dot{j}_2, j_3, \ldots, j_{n^2}+1$ are not all distinct: they can only take $n$ different values $1, 2, \ldots, n$. Note that each specific value $k$ appears in the sequence of numbers $j_1, j_2, j_2, j_3, j_3, \ldots, j_{n^2}, j_{n^2}, j_{n^2}+1$ exactly $2n$ times, since our table contains $n$ numbers in the $k$-th row and $n$ numbers in the $k$-th column. Since each number repeats twice "inside" the chain $j_1, j_2, j_2, j_3, \ldots, i_{n^2}, i_{n^2}+1$ (i.e., not in the first or last position), it follows from the fact that the value $j_1$ must appear in the chain an even number of $2n$ times that
$I_{n^2+1} = j_1$ - our chain must necessarily end with the same number $j_{\mathrm{f}}$ with which it began.

Thus, the problem requires us to estimate the difference between the sum of the numbers in the $j_1$-th row of the table and the sum of the numbers in the $j_1$-th column, the number of which coincides with the number of the row under consideration. But, due to the rule of forming the table, if $a_{j j_1} = s$ (where $j \neq j_{n^2}$ and, consequently, the pair $(j, j_1)$ is not the last in our chain, i.e., $s \neq n^2$), then $s+1 = a_{j_1 j_2}$; in other words, each number in the $j_1$-th column, except for $n^2$, corresponds to a number $s+1$ in the $j_1$-th row. In this case, the numbers $s+1 = a_{j_1 y_2}$ obtained in this way are all the numbers in the $j_1$-th row, except for the single number 1 (which, obviously, cannot follow any number in the $d_1$-th column, since it is the smallest in the table); therefore, if we denote the numbers in the $j_1$-th column, except for $n^2$, by $s_1, s_2, \ldots, s_{n-1}$, then the numbers in the $j_1$-th row, except for 1, will be $s_1+1$, $s_2+1, \ldots, s_{n-1}+1$. And from this it follows that the difference between the sum of the numbers in the $j$-th column and the sum of the numbers in the $j$-th row will be equal to:

$$
\begin{aligned}
& \left(s_1 + s_2 + \ldots + s_{n-1} + n^2\right) - \\
& \quad - \left[\left(s_1 + 1\right) + \left(s_2 + 1\right) + \ldots + \left(s_{n-1} + 1\right) + 1\right] = n^2 - n
\end{aligned}
$$
174. $n^{2}$ integers from 1 to $n^{2}$ are written in a square table of size $n \times n$: in this case, the number 1 is placed at any position in the table; 2 belongs to the row whose ordinal number is equal to the column number containing 1; the number 3 belongs to the row whose number matches the column number containing the number 2, and so on. By how much does the sum of the numbers in the row containing the number 1 differ from the sum of the numbers in the column containing the number $n^{2}$?[^3]