a,b = list(map(int,input().split())) if a>b : a,b=b,a i=a while i<=b: j=2 while j<i: if i%j==0: break; j=j+1 if j==i: print(i) i=i+1