#include <bits/stdc++.h>
const int INF = 0x7F7F7F7F;
const double EPS = 1e-10;
const long long mod7 = 1e9 + 7;
const long long mod9 = 1e9 + 9;
using namespace std;
inline long long rit() {
  long long f = 0, key = 1;
  char c;
  do {
    c = getchar();
    if (c == '-') key = -1;
  } while (c < '0' || c > '9');
  do {
    f = f * 10 + c - '0';
    c = getchar();
  } while (c >= '0' && c <= '9');
  return f * key;
}
inline void fprt(double f) { printf("%.08lf", f); }
void init() {}
const int Z = 1000005;
int n, k;
int a[Z], tree[Z * 4];
long long query(int p, int l, int r, int ql, int qr) {
  int mid = (l + r) >> 1;
  if (l == ql && r == qr) return tree[p];
  if (qr <= mid) {
    return query(p * 2, l, mid, ql, qr);
  } else if (ql > mid) {
    return query(p * 2 + 1, mid + 1, r, ql, qr);
  } else {
    return query(p * 2, l, mid, ql, mid) +
           query(p * 2 + 1, mid + 1, r, mid + 1, qr);
  }
}
void modify(int p, int l, int r, int x) {
  int mid = (l + r) >> 1;
  if (l == r) {
    tree[p]++;
    return;
  }
  if (x <= mid)
    modify(p * 2, l, mid, x);
  else
    modify(p * 2 + 1, mid + 1, r, x);
  tree[p] = tree[p * 2] + tree[p * 2 + 1];
}
void read() {
  n = rit(), k = rit();
  a[0] = 1;
  for (int i = 1; i < n; i++) {
    a[i] = (a[i - 1] - 1 + k) % n + 1;
  }
}
void solve() {
  long long ans = 1;
  int l, r;
  for (int i = 0; i < n; i++) {
    l = a[i];
    r = a[(i + 1) % n];
    if (l > r) swap(l, r);
    if ((l - 1 - 1 + 1) + (n - r - 1 + 1) < (r - 1 - (l + 1) + 1)) {
      if (1 <= l - 1) ans += query(1, 1, n, 1, l - 1);
      if (r + 1 <= n) ans += query(1, 1, n, r + 1, n);
    } else {
      ans += query(1, 1, n, l + 1, r - 1);
    }
    ans++;
    modify(1, 1, n, l);
    modify(1, 1, n, r);
    printf("%lld ", ans);
  }
  printf("\n");
}
int main() {
  int nn = 1;
  while (nn--) {
    init(), read(), solve();
  }
  return 0;
}
