"""
Entradas
k-->int-->k
n-->int-->n
Salidas
n-->int-->n
"""
n=0
k=int(input())
n=int(input())
while(k>=0 and n>=0):
  if(k<n):
    n=n-1
    print(n)
  elif(n<k):
    break
012a179bab4935a649e9714088108427269c7b86
<mask token>

<mask token>
while k >= 0 and n >= 0:
    if k < n:
        n = n - 1
        print(n)
    elif n < k:
        break

<mask token>
n = 0
k = int(input())
n = int(input())
while k >= 0 and n >= 0:
    if k < n:
        n = n - 1
        print(n)
    elif n < k:
        break

"""
Entradas
k-->int-->k
n-->int-->n
Salidas
n-->int-->n
"""
n=0
k=int(input())
n=int(input())
while(k>=0 and n>=0):
  if(k<n):
    n=n-1
    print(n)
  elif(n<k):
    break