#include <bits/stdc++.h>
#pragma GCC optimize(2)
using namespace std;
const long long rp = 666666;
const bool debug = 1;
const bool I_good_vegetable_a = 1;
const long long MAX_N = 1001000;
long long bit[MAX_N + 1], n, k;
long long sum(long long now) {
  long long s = 0;
  while (now > 0) {
    s += bit[now];
    now -= (now & -now);
  }
  return s;
}
void change(long long now, long long x) {
  while (now <= n) {
    bit[now] += x;
    now += (now & -now);
  }
}
inline long long calc(long long ow) {
  long long ans = ow % n;
  if (ans == 0) ans = n;
  return ans;
}
signed main() {
  ios::sync_with_stdio(false);
  cin >> n >> k;
  if (k * 2 > n) {
    k = n - k;
  }
  long long now = 1;
  long long ans = 1;
  do {
    long long to = calc(now + k);
    change(now, 1);
    change(to, 1);
    long long num;
    if (to < now)
      num = sum(n) - sum(now) + sum(to - 1);
    else
      num = sum(to - 1) - sum(now);
    ans += (num + 1);
    now = to;
    cout << ans << " ";
  } while (now != 1);
  cout << endl;
  return 0;
}
