# rotation-q1
# Sections 11-16, Q.1, p.54, p.256
# swaps blocks A, B of lengths n-k and k
# inputs: 4 20 or 7 20

k,n = map(int, input("k n=? ").split())
a = 0; b = n
d = k
c = n-k
x = [i for i in range(n)]

while (c != 0) and (d != 0):
  if d <= c:
    i = a
    while i != a+d:
      x[i], x[i+c] = x[i+c], x[i]
      i+= 1
    a += d
    c -= d
  else:  # c < d
    i = b-c
    while i != b:
      x[i], x[i-d] = x[i-d], x[i]
      i += 1
    b -= c
    d -= c
print(*x)
