Const
N = 5;
M = 6;
Var
A:array[1..N,1..M] of integer;
i,j:integer;
Begin
For i:= 1 to N do
Begin
if i mod 2 = 0 then
For j:= 1 to M do
Begin
A[i,j]:=(i-1)*M+j;
Write(A[i,j]:3)
End
else
For j:= M downto 1 do
Begin
A[i,j]:=(i-1)*M+j;
Write(A[i,j]:3)
End;
WriteLn
End;
ReadLn
End.