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