#include <bits/stdc++.h>
using namespace std;
long long tr[1000010];
int N, K;
int lowbit(int x) { return x & -x; }
long long getsum(int x) {
  long long s = 0;
  while (x) {
    s += tr[x];
    x -= lowbit(x);
  }
  return s;
}
void add(int x, int y) {
  while (x <= N) {
    tr[x] += y;
    x += lowbit(x);
  }
}
int main() {
  scanf("%d%d", &N, &K);
  if (K > N - K) K = N - K;
  long long ans = 1;
  int pos = 1, L, R;
  for (int i = 1; i <= N; i++) {
    ans++;
    L = pos - K + 1;
    R = pos + K - 1;
    if (L < 1) {
      ans += getsum(N) - (getsum(L + N - 1) - getsum(R));
    } else if (R > N) {
      ans += getsum(N) - (getsum(L - 1) - getsum(R - N));
    } else {
      ans += getsum(R) - getsum(L - 1);
    }
    add(pos, 1);
    printf("%I64d", ans);
    if (i < N) printf(" ");
    pos += K;
    if (pos > N) pos -= N;
  }
}
