const
n = 6;
var
i, j, k: integer;
a: array [1..6, 1..6] of integer;
begin
for i := 1 to n do
begin
for j := 1 to n do
begin
if (i = j) or (j = 1) or (i = 1) or (i = 6) or (j = 6) then
a[i, j] := 1
else
a[i, j] := 0;
write(a[i, j]:3);
end;
writeln();
end;
end.