N,K = map(int,input().split()) x = [1,3,2,4] a = [x[i%4] for i in range(N-K)] p = 0 if N-K == 0 else a[N-K-1] for i in range(K): a.append(p) print(' '.join([str(s) for s in a]))