n,k = map(int,input().split()) count = n-k-2 a,b = 2,1 ans = str(a) + " " + str(b) for i in range(n-2): if count > 0: count -= 1 if a>b: a,b = b,a+1 else: a,b = b,b-1 ans += " " + str(b) print(ans)