//PascalABC.NET 3.0
var i, j: integer;
begin
for i := 1 to 10 do
begin
for j := 1 to 10 do
if i = 1 then write(j : 3)
else if j = 10 then write(9 + i : 3)
else if i = 10 then write(29 - j : 3)
else if j = 1 then write(38 - i : 3)
else write(0 : 3);
writeln;
end;
end.