#include <bits/stdc++.h>
using namespace std;
long long n, k, t, ans, x, v, y, c, d, a[2 * 1000002];
bool f[1000002];
string s;
vector<long long> res;
long long query(long long p, long long q) {
  t = 0;
  for (p += n, q += n; p < q; p >>= 1, q >>= 1) {
    if (p & 1) t += a[p++];
    if (q & 1) t += a[--q];
  }
  return t;
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  cin >> n >> k;
  x = 1;
  k = min(k, n - k);
  a[n + 1] = 1;
  d = 1;
  for (long long i = n - 1; i > 0; --i) a[i] = a[i << 1] + a[i << 1 | 1];
  while (true) {
    y = x + k;
    if (y > n) y = x + k - n;
    if (a[y + n] == 2) break;
    if (x < y) {
      c = query(x + 1, y);
      d += c + 1;
      res.push_back(d);
    } else {
      c = query(x + 1, n + 1) + query(1, y);
      d += c + 1;
      res.push_back(d);
    }
    v = y;
    for (a[v += n] = 2; v > 1; v >>= 1) a[v >> 1] = a[v] + a[v ^ 1];
    x = y;
  }
  for (long long it : res) cout << it << " ";
  cout << endl;
  return 0;
}
