I won't try to make a diagram.Thirty-five student are seated in five rows and seven columns.
Is it possible for the student to change seats if every student much moves
exactly one seat to the left, right, front, or back? . No
Assume that it is possible.
Color the 5-by-7 grid in "checkerboard" fashion,
. . alternating black and white squares.
Start with a black square in the upper-left.
. . There will be 18 black squares and 17 white squares.
Now, picture all thirty-five students seated in the array.
Since they will orthogonally (right, left, up or down),
. . the 18 students on black squares will move to a white square
. . and the 17 students on white squares will move to a black square.
And the final diagram will have 18 white squares and 17 black squares.
Since this is clearly impossible, our assumption is wrong.
. . Therefore, the desired seat-change is impossible.