#include <bits/stdc++.h>
using namespace std;
vector<long long> t;
long long n, k;
long long sum(long long r) {
  if (r < 0) return 0;
  long long res = 0;
  for (; r >= 0; r = (r & (r + 1)) - 1) res += t[r];
  return res;
}
long long sum(long long l, long long r) {
  if (l <= r)
    return sum(r) - sum(l - 1);
  else
    return sum(r) + sum(n - 1) - sum(l - 1);
}
void add(long long i, long long d) {
  for (; i < n; i = (i | (i + 1))) t[i] += d;
}
signed main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> k;
  if (2 * k > n) k = n - k;
  t.assign(n, 0);
  long long cur = 0;
  long long ans = 1;
  for (long long i = 0; i < n; ++i) {
    long long l = cur;
    long long r = cur + k;
    if (r >= n) r -= n;
    ans = ans + 1 + sum(l, r);
    add(cur, cur == 0 ? 1 : 2);
    cur += k;
    if (cur >= n) cur -= n;
    cout << ((i == n - 1) ? ans - 1 : ans) << ' ';
  }
  return 0;
}
