#include <bits/stdc++.h>
using namespace std;
long long it[4 * 1000007], ans = 1, n, k, pre, pos;
void upd(long long node, long long l, long long r, long long pos) {
  if (pos < 1) return;
  if (r < pos || l > pos) return;
  if (pos == l && l == r) {
    it[node]++;
    return;
  }
  upd(2 * node, l, ((l + r) >> 1), pos);
  upd(2 * node + 1, ((l + r) >> 1) + 1, r, pos);
  it[node] = it[2 * node] + it[2 * node + 1];
}
long long get(long long node, long long l, long long r, long long u,
              long long v) {
  if (u > v) return 0;
  if (v < l || u > r) return 0;
  if (u <= l && r <= v) return it[node];
  return get(node * 2, l, ((l + r) >> 1), u, v) +
         get(node * 2 + 1, ((l + r) >> 1) + 1, r, u, v);
}
signed main() {
  cin >> n >> k;
  pos = 1;
  if (k * 2 > n) {
    for (long long i = 1; i <= n; ++i) {
      pre = pos;
      pos += k;
      if (pos <= n) {
        ans += get(1, 1, n, pos + 1, n) + get(1, 1, n, 1, pre - 1) + 1;
        upd(1, 1, n, pre);
        upd(1, 1, n, pos);
        cout << ans << " ";
        continue;
      }
      pos %= n;
      ans += get(1, 1, n, pos + 1, pre - 1) + 1;
      upd(1, 1, n, pre);
      upd(1, 1, n, pos);
      cout << ans << " ";
    }
    return 0;
  }
  for (long long i = 1; i <= n; ++i) {
    pre = pos;
    pos += k;
    if (pos <= n) {
      ans += get(1, 1, n, pre + 1, pos - 1) + 1;
      upd(1, 1, n, pre);
      upd(1, 1, n, pos);
      cout << ans << " ";
      continue;
    }
    pos %= n;
    ans += get(1, 1, n, pre + 1, n) + get(1, 1, n, 1, pos - 1) + 1;
    upd(1, 1, n, pre);
    upd(1, 1, n, pos);
    cout << ans << " ";
  }
  return 0;
}
