import sys input=lambda: sys.stdin.readline().rstrip() n,k=map(int,input().split()) A=[1,3,2,4] Ans=A*((n-k)//4)+A[:(n-k)%4] if Ans[-1]>Ans[-2]: d=1 else: d=-1 for _ in range(k): Ans.append(Ans[-1]+d) print(*Ans)