#include <bits/stdc++.h>
using namespace std;
long long BIT[1000005];
long long ans[1000005];
int n, k;
int now, nxt;
bool tambel;
void add(int x) {
  ++x;
  for (int i = x; i < 1000005; i += i & -i) {
    ++BIT[i];
  }
}
long long get(int x) {
  long long ret = 0;
  ++x;
  for (int i = x; i > 0; i -= i & -i) ret += BIT[i];
  return ret;
}
int getShorter(int x, int y) {
  if (abs(x - y) < n - abs(x - y)) return 0;
  return 1;
}
int main() {
  cin >> n >> k;
  now = 1;
  ans[0] = 1;
  for (int i = 1; i <= n; ++i) {
    nxt = now + k;
    if (nxt > n) nxt -= n;
    if (getShorter(nxt, now)) {
      if (now < nxt) {
        tambel = true;
        swap(now, nxt);
      }
      ans[i] = ans[i - 1] + get(n) - get(now) + get(nxt - 1) + 1;
      if (tambel) {
        tambel = false;
        swap(now, nxt);
      }
    } else {
      if (now > nxt) {
        tambel = true;
        swap(now, nxt);
      }
      ans[i] = ans[i - 1] + get(nxt - 1) - get(now) + 1;
      if (tambel) {
        tambel = false;
        swap(now, nxt);
      }
    }
    add(now);
    add(nxt);
    now = nxt;
  }
  for (int i = 1; i <= n; ++i) {
    cout << ans[i];
    if (i != n)
      cout << ' ';
    else
      cout << '\n';
  }
}
