Rotate a matrix just like printing it spirally.