n,k = map(int,input().split()) A = [0,1] now = 1 for i in range(n-2): if i < n - k - 2: now ^= 1 A.append(now) print(*A)