#include <bits/stdc++.h>
using namespace std;
template <typename Arg1>
void __f(const char* name, Arg1&& arg1) {
  cerr << name << " : " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args) {
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
long long int BIT[1000006];
void update(int x, int val, int n) {
  for (; x <= n; x += (x & -x)) {
    BIT[x] += val;
  }
  return;
}
long long int getSum(int x) {
  long long int sum = 0;
  for (; x > 0; x -= x & -x) {
    sum += BIT[x];
  }
  return sum;
}
long long int query(int x1, int x2) {
  long long int ans = getSum(x2) - getSum(x1);
  return ans;
}
int main() {
  int n, k;
  long long int xx = 0, yy, x, y, ans = 1, ans1, ans2;
  scanf("%d", &n);
  scanf("%d", &k);
  k = min(k, n - k);
  for (int i = 0; i < n; i++) {
    yy = (xx + k) % n;
    x = xx + 1, y = yy + 1;
    if (y > x) {
      ans1 = query(x, y - 1) + 1;
      ans += ans1;
    } else {
      ans2 = query(x, n) + query(0, y - 1) + 1;
      ans += ans2;
    }
    update(x, 1, n);
    update(y, 1, n);
    printf("%lld ", ans);
    xx = yy;
  }
  return 0;
}
