#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k;
  cin >> n >> k;
  k = min(k, n - k);
  long long cnt = -1;
  long long x = 1;
  vector<int> ans;
  while (x != 1 || cnt == -1) {
    long long aux = (n - x + 1) / k;
    if (aux > 0) {
      x += aux * k;
      if (x > n) x -= n;
      cnt++;
      for (long long i = 0; i < aux; i++) {
        ans.push_back(cnt);
      }
    } else {
      x = x + k - n;
      cnt++;
      ans.push_back(cnt);
    }
  }
  long long xx = 1;
  for (long long i = 0; i < ans.size(); i++) {
    xx += ans[i] + 1;
    cout << xx << " ";
  }
  return 0;
}
