solve spiral matrix