#include
using namespace std;
int main() {
int n,N1,N2,S,count=0;
cin>>N1;
cin>>N2;
n=1;
while(count<=N1){
S=3*n+2;
if(S%N2!=0){
count=count+1;
cout<<S<<endl;
}
n=n+1;
}
return 0;
}
#include
using namespace std;
int main() {
int n,N1,N2,S,count=0;
cin>>N1;
cin>>N2;
n=1;
while(count<=N1){
S=3*n+2;
if(S%N2!=0){
count=count+1;
cout<<S<<endl;
}
n=n+1;
}
return 0;
}