print array in spiral order