#include <bits/stdc++.h>
using namespace std;
long long tree[1000010 << 2];
vector<long long> ans;
void pushup(int rt) { tree[rt] = tree[rt << 1] + tree[rt << 1 | 1]; }
void update(int rt, int l, int r, int id) {
  if (l == r && l == id) {
    tree[rt]++;
    return;
  }
  int m = (l + r) >> 1;
  if (id <= m)
    update(rt << 1, l, m, id);
  else
    update(rt << 1 | 1, m + 1, r, id);
  pushup(rt);
}
long long query(int rt, int l, int r, int L, int R) {
  long long ans = 0;
  if (L <= l && r <= R) return tree[rt];
  int m = (l + r) >> 1;
  if (L <= m) ans += query(rt << 1, l, m, L, R);
  if (m < R) ans += query(rt << 1 | 1, m + 1, r, L, R);
  return ans;
}
long long getsum(int l, int r, int n) {
  long long ans = 0;
  if (l > r) {
    ans += query(1, 1, n, l, n);
    ans += query(1, 1, n, 1, r);
  } else {
    ans += query(1, 1, n, l, r);
  }
  return ans;
}
int main() {
  int n, k;
  cin >> n >> k;
  int now = 1 + k, pre;
  if (k > n / 2) k = n - k;
  long long res = 1;
  for (int i = 1; i <= n; i++) {
    pre = now;
    update(1, 1, n, pre);
    now += k;
    if (now > n) now -= n;
    res += getsum(pre, now, n) - 1;
    ans.push_back(res);
    update(1, 1, n, now);
  }
  for (int i = 0; i < n - 1; i++) printf("%I64d ", ans[i] + 1);
  printf("%I64d\n", ans[n - 1]);
  return 0;
}
