N,K = map(int,input().split()) if K == N-2: print(*[1]*(N)) exit() ls = [1,3,2] for i in range(N-K-3): if ls[-2] > ls[-1]: ls.append(ls[-1]+2) else: ls.append(ls[-1]-1) ls += [ls[-1]]*(N-len(ls)) print(*ls)