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