eolymp
bolt
Try our new interface for solving problems
Problems

Filling

Filling

Fill the array n × n with a "snake" (see example).

Input

One integer n (n500).

output

Print the array n × n filled with a "snake".

Time limit 1 second
Memory limit 64 MiB
Input example #1
3
Output example #1
1 2 3
6 5 4
7 8 9