added: print a given matrix spirally