#include <bits/stdc++.h>
using namespace std;
long long a[1000003];
int bit[1000003];
int read(int idx) {
  int sum = 0;
  if (idx == 0) return 0;
  while (idx > 0) {
    sum += bit[idx];
    idx -= (idx & -idx);
  }
  return sum;
}
void update(int idx, int val) {
  while (idx <= 1000003) {
    bit[idx] += val;
    idx += (idx & -idx);
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  int n, k;
  long long ans = 1;
  cin >> n >> k;
  k = min(k, n - k);
  if (k == n - 1) {
    for (int i = 1; i < n + 1; i++) cout << "1 ";
    return 0;
  }
  for (int i = 1, cur = 1; i <= n; i++, cur += k) {
    if (cur > n) cur -= n;
    long long p = cur;
    while (p > n) p -= n;
    long long q = cur + k;
    while (q > n) q -= n;
    long long val;
    if (q > p)
      val = read(q - 1) - read(p);
    else
      val = read(n) - read(p) + read(q - 1);
    ans += 1LL * (val + 1);
    update(p, 1);
    update(q, 1);
    cout << ans << " ";
  }
  return 0;
}
