Given a two-dimensional square matrix of order n x n, swap the elements in the upper and lower quarters and also swap the elements in the left and right quarters, excluding elements located on the diagonals. The matrix is divided into four quarters, bounded by the main and secondary diagonals: upper, lower, left, and right.
5
1 4 5 6 5
5 6 7 8 9
9 0 1 2 4
3 4 5 6 0
1 2 3 2 1
Sample Output 0
1 2 3 2 5
9 6 5 8 5
4 2 1 0 9
0 4 7 6 3
1 4 5 6 1
