#include<bits/stdc++.h>
using namespace std;
const int N = 101; // const usually written in Capital letters
int out[N], n, m, pos;
int main(){
//input
cin >> n >> m;
for(int i = 1; i <= n; ++i){ // repeat n times, one person out every time
int bs = 0; // record times of yell no.
while(bs < m){
++pos;
if(pos == n + 1)
pos = 1;// next person
if(out[pos] == 0){
++bs;
}
}
out[pos] = 1;
cout << pos << " ";
}
return 0;
}