#include <bits/stdc++.h>
using namespace std;
long long n;
long long tree[1000005];
long long read(int idx) {
  int sum = 0;
  while (idx > 0) {
    sum += tree[idx];
    idx -= (idx & -idx);
  }
  return sum;
}
void update(int idx, long long val) {
  while (idx <= n) {
    tree[idx] += val;
    idx += (idx & -idx);
  }
}
int main() {
  long long k;
  cin >> n >> k;
  k = min(k, n - k);
  long long x = 1;
  long long sum = 1;
  while (1) {
    long long prev = x;
    if (x + k > n)
      x = x + k - n;
    else
      x = x + k;
    int temp = read(prev);
    int temp1 = read(x);
    sum += (temp1 + temp + 1);
    if (prev < x) {
      update(prev + 1, 1);
      update(x, -1);
    } else {
      update(1, 1);
      update(x, -1);
      if (prev + 1 <= n) {
        update(prev + 1, 1);
        update(n + 1, -1);
      }
    }
    cout << sum << " ";
    if (x == 1) break;
  }
  return 0;
}
