https://www.acmicpc.net/problem/1929
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner s=new Scanner(System.in);
int m=s.nextInt();
int n=s.nextInt();
for(int i=m;i<=n;i++){
int k=0;
if(i==1) k=1;
for(int j=2;j<=Math.sqrt(i);j++){
if(i%j==0){
k=1;
break;
}
}
if(k==0) System.out.println(i);
}
}
}