#include <bits/stdc++.h>
using namespace std;
int main() {
  long long n, k, pos, inc, last;
  bool space = false;
  cin >> n >> k;
  last = 1;
  inc = 0;
  pos = 1;
  k = min(k, n - k);
  for (int i = 0; i < n; i++) {
    if (space) cout << " ";
    space = true;
    if (pos + k > n) {
      pos = pos + k - n;
      inc += 2;
    } else {
      pos += k;
    }
    if (pos == 1)
      last += inc - 1;
    else if (pos <= k)
      last += inc;
    else
      last += inc + 1;
    cout << last;
  }
  cout << endl;
  return 0;
}
