eolymp
bolt
Try our new interface for solving problems

Snake

Deduce the square, consisting of \textbf{N}x\textbf{N} cells filled with numbers from \textbf{1} to \textbf{N^2} "snake" (see examples). \InputFile The first line is a single number \textbf{N} (\textbf{2} ≤ \textbf{N} ≤ \textbf{100}). \OutputFile Output \textbf{N} rows of \textbf{N} numbers, separated by a space. Not be permitted beginning snake in the other corner or another of its direction.
Time limit 1 second
Memory limit 64 MiB
Input example #1
3
Output example #1
1 2 6
3 5 7
4 8 9