#include <bits/stdc++.h>
using namespace std;
int ft[1000005];
void update(int i, int v) {
  for (; i <= 1000000; i += (i & -i)) ft[i] += v;
}
int query(int i) {
  int res = 0;
  for (; i > 0; i -= (i & -i)) res += ft[i];
  return res;
}
int main() {
  int n, k;
  scanf("%d%d", &n, &k);
  long long ans = 1;
  int cur = 1, pv = 1;
  for (int i = 1; i <= n; i++) {
    cur += k;
    if (cur > n) cur -= n;
    if (k <= n / 2) {
      int face = 0;
      if (pv <= cur) {
        face += query(cur - 1) - query(pv);
      } else {
        face += query(cur - 1) + query(n) - query(pv);
      }
      ans += face + 1;
    } else {
      int face = 0;
      if (cur <= pv) {
        face += query(pv - 1) - query(cur);
      } else {
        face += query(pv - 1) + query(n) - query(cur);
      }
      ans += face + 1;
    }
    update(pv, 1);
    update(cur, 1);
    pv = cur;
    printf("%lld ", ans);
  }
}
