import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner s= new Scanner(System.in);
int N1=s.nextInt();
int N2=s.nextInt();
int n=1;
while(n<=N1){
if((3n+2)%N2==0){
System.out.print("");
}
else{
System.out.println(3n+2);
}
n++;
}
}
}