const
  maxn = 1000;
type
  integer = longint;
var
  i, j, n, k : integer;
  a : array[1..maxn] of integer;

begin
  assign(input, 'haircut.in');
  assign(output, 'haircut.out');
  reset(input);
  rewrite(output);
  read(n, k);
  assert((2 <= k) and (k <= n) and (n <= maxn));
  for i := 1 to k do begin
    j := i mod k + 1;
    while (j <= n) do begin
      a[j] := i;
      j := j + k;
    end;
  end;
  for i := 1 to n do begin
    write(a[i], ' ');
  end;
end.