#include <bits/stdc++.h>
using namespace std;
int dx[] = {0, 1, 0, -1, -1, -1, 1, 1};
int dy[] = {1, 0, -1, 0, 1, -1, 1, -1};
const int MAX = 1000100;
long long bit[1000100];
int c[MAX];
int n, k;
void update(int x) {
  c[x]++;
  while (x < MAX) {
    bit[x]++;
    x += x & (-x);
  }
}
long long query(int x) {
  long long res = 0;
  while (x > 0) {
    res += bit[x];
    x -= x & (-x);
  }
  return res;
}
long long query(int x, int y) {
  if (x > y) return 0;
  return query(y) - query(x - 1);
}
int main() {
  scanf("%d", &n);
  scanf("%d", &k);
  if (k * 2 > n) k = n - k;
  long long sum = 1;
  long long now = 1;
  long long res;
  for (int i = 0; i < n; i++) {
    if (now + k <= n) {
      sum += query(now + 1, now + k - 1) + 1;
    } else {
      long long to = now + k - n;
      sum += query(now + 1, n) + query(1, to - 1) + 1;
    }
    update(now);
    now += k;
    if (now > n) now -= n;
    update(now);
    printf("%I64d ", sum);
  }
}
