Print NxN matrix spirally and diagonally