#include <bits/stdc++.h>
using namespace std;
int main() {
  long long int n, k, s = 1, q = 1, w = 1;
  cin >> n >> k;
  if (k > n / 2) k = n - k;
  while (1) {
    q += k;
    if (q > n) {
      q = q - n;
      if (q == 1) {
        cout << s + w;
        return 0;
      }
      w++;
      s += w;
      w++;
      cout << s << ' ';
    } else {
      s += w;
      cout << s << ' ';
    }
  }
  return 0;
}
