#include <bits/stdc++.h>
int ___read_tmp;
using namespace std;
int fwt[1010000];
int query(int sz) {
  int sum = 0;
  sz++;
  while (sz > 0) {
    sum += fwt[sz];
    sz -= sz & (-sz);
  }
  return sum;
}
void upd(int id, int add) {
  id++;
  for (; id < 1010000; id += (id & (-id))) {
    fwt[id] += add;
  }
}
int range(int from, int to) {
  if (to < from) return 0;
  int tmp = query(to);
  if (from > 0) tmp -= query(from - 1);
  return tmp;
}
int main() {
  int n, k;
  scanf("%d %d", &n, &k);
  k = min(k, n - k);
  unsigned long long res = 1;
  int curr = 0;
  for (int i = (0); i < (n); i++) {
    if (curr + k <= n) {
      res += range(curr + 1, curr + k - 1) + 1;
    } else {
      res += range(curr + 1, n - 1) + range(0, (curr + k) % n - 1) + 1;
    }
    printf("%I64d ", res);
    upd(curr, 1);
    curr = (curr + k) % n;
    upd(curr, 1);
  }
  return 0;
}
