AIME I 2026 (Problem 11)

The integers from 1 to 64 are placed in some order into an 8×88\times8 grid of cells with one number in each cell. Let ai,ja_{i,j} be the number placed in the cell in row ii and column jj, and let MM be the sum of the absolute differences between adjacent cells. That is,
M=i=18j=17(ai,j+1ai,j+aj+1,iaj,i).M=\sum_{i=1}^{8}\sum_{j=1}^{7}(|a_{i,j+1}-a_{i,j}|+|a_{j+1,i}-a_{j,i}|).
Find the remainder when the maximum possible value of MM is divided by 10001000.