import java.io.*;
class Primenumber {
public static void main(String[] args) throws IOException{
int i,j,count,m;
DataInputStream in=new DataInputStream(System.in);
System.out.println("\nENTER THE NUMBER OF TERMS TO BE GENERATED : ");
int num = Integer.parseInt(in.readLine());
System.out.println("\n"+num+" PRIME NUMBERS :\n");
if(num == 1){System.out.println("1 ");}
else{
System.out.print("1 ");
i=1;m=2;
do
{
count=0;
for (j=1; j<=i; j++)
{
int n = i%j;
if (n==0)
{
count++;
}
}
if(count == 2){System.out.print(i+" ");m++;}
i++;
}while(m<=num);
System.out.println("\n");
}
}
}
class Primenumber {
public static void main(String[] args) throws IOException{
int i,j,count,m;
DataInputStream in=new DataInputStream(System.in);
System.out.println("\nENTER THE NUMBER OF TERMS TO BE GENERATED : ");
int num = Integer.parseInt(in.readLine());
System.out.println("\n"+num+" PRIME NUMBERS :\n");
if(num == 1){System.out.println("1 ");}
else{
System.out.print("1 ");
i=1;m=2;
do
{
count=0;
for (j=1; j<=i; j++)
{
int n = i%j;
if (n==0)
{
count++;
}
}
if(count == 2){System.out.print(i+" ");m++;}
i++;
}while(m<=num);
System.out.println("\n");
}
}
}