#include <bits/stdc++.h>
using namespace std;
int tree[1000005 << 2];
void pushup(int rt) { tree[rt] = tree[rt << 1] + tree[rt << 1 | 1]; }
void build(int l, int r, int rt) {
  tree[rt] = 0;
  if (l == r) {
    return;
  }
  int mid = (l + r) >> 1;
  build(l, mid, rt << 1);
  build(mid + 1, r, rt << 1 | 1);
}
void update(int pos, int val, int l, int r, int rt) {
  if (l == r) {
    tree[rt] += val;
    return;
  }
  int mid = (l + r) >> 1;
  if (pos <= mid) {
    update(pos, val, l, mid, rt << 1);
  } else {
    update(pos, val, mid + 1, r, rt << 1 | 1);
  }
  pushup(rt);
}
int query(int L, int R, int l, int r, int rt) {
  if (L <= l && R >= r) {
    return tree[rt];
  }
  int mid = (l + r) >> 1;
  int res = 0;
  if (L <= mid) {
    res += query(L, R, l, mid, rt << 1);
  }
  if (R > mid) {
    res += query(L, R, mid + 1, r, rt << 1 | 1);
  }
  return res;
}
long long ans[1000005];
int main() {
  int n, k, L, R, pos, i;
  long long t;
  while (scanf("%d%d", &n, &k) != EOF) {
    if (k > n / 2) {
      k = n - k;
    }
    build(1, n, 1);
    ans[0] = 1;
    pos = 1;
    for (i = 1; i <= n; i++) {
      L = (pos + 1) % n;
      if (L == 0) {
        L = n;
      }
      R = ((k + pos - 1) % (n) + (n)) % (n);
      if (R == 0) {
        R = n;
      }
      if (R >= L) {
        t = query(L, R, 1, n, 1);
      } else {
        t = query(L, n, 1, n, 1) + query(1, R, 1, n, 1);
      }
      if (t != 0) {
        ans[i] = ans[i - 1] + 1 + t;
      } else {
        ans[i] = ans[i - 1] + 1;
      }
      update(pos, 1, 1, n, 1);
      int tt = (pos + k) % n;
      if (tt == 0) {
        tt = n;
      }
      update(tt, 1, 1, n, 1);
      pos = (pos + k) % (n);
      if (pos == 0) {
        pos = n;
      }
    }
    for (i = 1; i <= n; i++) {
      printf("%lld ", ans[i]);
    }
    printf("\n");
  }
}
