#include <bits/stdc++.h>
using namespace std;
vector<long long> t;
int n;
long long sum(int r) {
  long long result = 0;
  for (; r >= 0; r = (r & (r + 1)) - 1) result += t[r];
  return result;
}
void inc(int i, int delta) {
  for (; i < n; i = (i | (i + 1))) t[i] += delta;
}
long long sum(int l, int r) { return sum(r) - sum(l - 1); }
int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  int k;
  cin >> n >> k;
  t.assign(n, 0);
  long long ans = 1;
  int cur = 0;
  for (int ITER = 0; ITER < n; ++ITER) {
    int to = (cur + k) % n;
    int l = min(to, cur);
    int r = max(to, cur);
    int up = (r - l + n) % n;
    int down = (l - r + n) % n;
    if (up < down) {
      ans += sum(l + 1, r - 1) + 1;
    } else {
      ans += sum(r + 1, n - 1) + sum(0, l - 1) + 1;
    }
    inc(l, 1);
    inc(r, 1);
    cout << ans << " ";
    cur = to;
  }
}
