m,n=list(map(int,input().split())) i=m while i>=m and i<=n: j=2 while j<i: if i%j==0: break j+=1 else: print(i) i+=1