#include <bits/stdc++.h>
using namespace std;
long long n, k, sum = 1;
int d[1000005];
long long lowbit(int x) { return x & (-x); }
int getsum(int x) {
  int res = 0;
  while (x) {
    res += d[x];
    x -= lowbit(x);
  }
  return res;
}
int change(int num) {
  num += k;
  if (num > n)
    return num - n;
  else
    return num;
}
void add(int x, int v) {
  while (x <= n) {
    d[x] += v;
    x += lowbit(x);
  }
}
long long g(long long num) {
  long long S;
  if (num + k <= n + 1) {
    S = getsum(num + k - 1) - getsum(num);
  } else {
    S = getsum(n) - getsum(num) + getsum(num + k - 1 - n);
  }
  return S;
}
int main() {
  cin >> n >> k;
  k = min(k, n - k);
  int idx = 1;
  for (int i = 1; i <= n; i++) {
    add(idx, 1);
    sum += g(idx) + 1;
    cout << sum << " ";
    idx = change(idx);
    add(idx, 1);
  }
}
