#! -*- coding: UTF-8 -*- i,j= map(int,raw_input().strip().split()) for n in range(i,j+1): for k in range(2,n): if n % k ==0: break else: print n