program pasck;
var
i1, i, n, count : integer;
begin
read(n);
case n of
1..9: count:=2;
10..99: count:=3;
100..999: count:=4;
else count:=5;
end;
for i:=0 to n-1 do
begin
writeln;
for i1:=0 to n-i-1 do write(i+1:count);
for i1:=n-i+1 to n do write(0:count);
end;
end.