Var a : array[1..100] of integer;
j, i, n, k, out_num, is_out : integer;
Begin
read(n); {всего людей}
read(out_num); {номер выходящего, в задаче = 3}
for i := 1 to n do
a[i] := 1;
i := -1;
repeat
i:= (i + 1) mod n;
k := k + a[i+1];
if k = out_num then begin
a[i+1] := 0;
is_out := is_out + 1;
k := 0;
writeln;
for j := 1 to n do write(a[j]:2);
end;
until n - is_out <= 1;<br>
writeln;
for i := 1 to n do
if a[i] > 0 then writeln(i);
End.