#include <bits/stdc++.h>
using namespace std;
const long long maxn = 1000000 + 10;
long long tree_array[maxn];
long long n, k;
long long lowbit(long long a) { return a & -a; }
void update(long long a) {
  while (a <= n) {
    tree_array[a]++;
    a += lowbit(a);
  }
}
long long sum(long long a) {
  long long z = 0;
  while (a) {
    z += tree_array[a];
    a -= lowbit(a);
  }
  return z;
}
int main() {
  scanf("%lld%lld", &n, &k);
  k = min(k, n - k);
  long long b = 1;
  long long t;
  long long z = 1;
  for (long long i = 1; i <= n; i++, b = t) {
    t = b + k;
    if (t > n) t %= n;
    if (t > b)
      z += (sum(t - 1) - sum(b) + 1);
    else
      z += (sum(n) - sum(b) + sum(t - 1) + 1);
    printf("%lld ", z);
    update(b);
    update(t);
  }
  return 0;
}
