a=list(map(int,input().split())) for i in range(a[0],a[1]+1): t=0 if i==2: print(i) else: for j in range(2,i): if i%j==0: t=1 break if t==0: print(i)