#include <bits/stdc++.h>
int tree[1000011];
int n, k;
void push(int pos, int val) {
  if (pos == 0) return;
  while (pos <= n) {
    tree[pos] += val;
    pos += pos & -pos;
  }
  return;
}
int get(int pos) {
  int ret = 0;
  while (pos) {
    ret += tree[pos];
    pos -= pos & -pos;
  }
  return ret;
}
int main() {
  long long ans = 1;
  scanf("%d %d", &n, &k);
  if (k * 2 >= n) k = n - k;
  int now = 1;
  for (int i = 1; i <= n; i++) {
    int x = 0;
    if (now - k + 1 <= 0) {
      x += get(n) - get(now - k + n);
      x += get(now - 1);
    } else {
      x += get(now - 1) - get(now - k);
    }
    if (now + k > n) {
      x += get(n) - get(now);
      x += get(now + k - n - 1);
    } else
      x += get(now + k - 1) - get(now);
    ans += x + 1;
    printf("%lld ", ans);
    push(now, 1);
    now += k;
    if (now > n) now -= n;
  }
  return 0;
}
