#include <bits/stdc++.h>
using namespace std;
int n, k;
int first[5000000], pot;
void update(int leaft) {
  int node = pot + leaft;
  first[node]++;
  node /= 2;
  while (node > 0) {
    first[node]++;
    node /= 2;
  }
}
int query(int node, int l, int r, int L, int R) {
  if (r < L || R < l)
    return 0;
  else if (L <= l && r <= R)
    return first[node];
  else
    return query(2 * node, l, (l + r) / 2, L, R) +
           query(2 * node + 1, (l + r) / 2 + 1, r, L, R);
}
long long q(int idx_b, int idx_e) {
  if (k == 1)
    return 0;
  else {
    if (idx_b <= idx_e)
      return query(1, 0, pot - 1, idx_b, idx_e);
    else
      return query(1, 0, pot - 1, idx_b, n - 1) +
             query(1, 0, pot - 1, 0, idx_e);
  }
}
void init() {
  pot = 1;
  while (pot < n) pot *= 2;
}
int main() {
  scanf("%d %d", &n, &k);
  if (2 * k >= n) k = n - k;
  init();
  int id = 0;
  long long solution = 1;
  for (int i = 0; i < int(n); i++) {
    solution += q(id + 1, (id + k - 1) % n) + 1ll;
    printf("%lld%c", solution, i == n - 1 ? '\n' : ' ');
    update(id);
    update((id + k) % n);
    id += k;
    id %= n;
  }
}
