#include <bits/stdc++.h>
using namespace std;
long long n, m, now = 1, sum = 1, hav = 1;
int main() {
  cin >> n >> m;
  if (m > n / 2) m = n - m;
  for (int i = 1; i <= n; i++) {
    now += m;
    if (now <= n)
      sum += hav;
    else {
      hav += 2;
      sum += hav - 1 - (i == n);
      now -= n;
    }
    cout << sum << " ";
  }
  return 0;
}
