#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  int n, k, pos, t, newpos;
  long long ans, round;
  cin >> n >> k;
  t = n;
  ans = 1;
  pos = 1;
  round = 0;
  k = min(k, n - k);
  while (t--) {
    pos + k > n ? newpos = pos + k - n : newpos = pos + k;
    if (newpos < pos && newpos != 1) {
      round++;
      ans += round * 2;
    } else
      ans += (2 * round + 1);
    pos = newpos;
    cout << ans << " ";
  }
  return 0;
}
