4. Fill a 5x5 table with five 1s, five 2s, five 3s, five 4s, and five 5s (one number per cell), such that the absolute difference between any two numbers in the same column does not exceed 2. Consider the sum of the numbers in each column, and let the minimum of these five sums be $M$. Then the maximum value of $M$ is $\qquad$
4. 10 .

According to the different scenarios of the distribution of five 1s in columns, find the maximum value of $M$.
If the five 1s are distributed in the same column, then $M=5$;
If the five 1s are distributed in two columns, then by the problem's condition, the maximum number in these two columns is at most 3.
Thus, $2 M \leqslant 5 \times 1 + 5 \times 3 = 20$
$\Rightarrow M \leqslant 10$;
If the five 1s are distributed in three columns, then by the problem's condition, the maximum number in these three columns is at most 3.
Thus, $3 M \leqslant 5 \times 1 + 5 \times 2 + 5 \times 3 = 30$
$\Rightarrow M \leqslant 10$;
If the five 1s are distributed in at least four columns, then there must be a column with a number greater than 3, which contradicts the problem's condition.
In summary, $M \leqslant 10$.
Table 1 shows that $M$ can reach 10. Therefore, the maximum value of $M$ is 10.