n=map(int,raw_input().strip().split()) x=n[0] y=n[1] for i in range(x,y+1): for j in range(2,i): if i%j==0: break else: print i