n,m=map(int,raw_input().strip().split()) for i in range(n,m+1): f=True for j in range(2,i): if i%j==0: f=False break if f==True: print i