#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:36777216")
using namespace std;
template <typename T, typename T2 = T>
class SumTree {
  struct Node {
    T2 sum;
    T2 delta;
  };
  vector<Node> tree;
  size_t size_;
  void BuildTree(size_t a, size_t left, size_t right) {
    if (a >= tree.size()) {
      tree.resize(a + 1);
    }
    if (right > left) {
      BuildTree(2 * a + 1, left, (left + right) / 2);
      BuildTree(2 * a + 2, (left + right) / 2 + 1, right);
    }
  }
  void UpdateNode(size_t a) {
    tree[a].sum = tree[2 * a + 1].sum + tree[2 * a + 2].sum;
  }
  void Add(size_t a, size_t left, size_t right, size_t from, size_t to, T val) {
    if (right < from || left > to) {
      return;
    }
    if (from <= left && right <= to) {
      tree[a].delta += val;
      tree[a].sum += (right - left + 1) * val;
      return;
    }
    Add(2 * a + 1, left, (left + right) / 2, from, to, val);
    Add(2 * a + 2, (left + right) / 2 + 1, right, from, to, val);
    UpdateNode(a);
  }
  T2 GetSum(size_t a, size_t left, size_t right, size_t from, size_t to) {
    if (right < from || left > to) {
      return T2();
    }
    if (from <= left && right <= to) {
      return tree[a].sum;
    }
    return GetSum(2 * a + 1, left, (left + right) / 2, from, to) +
           GetSum(2 * a + 2, (left + right) / 2 + 1, right, from, to) +
           (to - from + 1) * tree[a].delta;
  }

 public:
  explicit SumTree(size_t size) : size_(size) { BuildTree(0, 0, size_ - 1); }
  void Add(size_t from, size_t to, T val) {
    Add(0, 0, size_ - 1, from, to, val);
  }
  void Add(size_t index, T val) { Add(index, index, val); }
  T2 GetSum(size_t from, size_t to) {
    return GetSum(0, 0, size_ - 1, from, to);
  }
  T2 GetValue(size_t index) { return GetSum(index, index); }
};
int main() {
  int n, k;
  cin >> n >> k;
  if (k > n - k) {
    k = n - k;
  }
  SumTree<int> tree(n);
  long long E = n;
  long long V = n;
  int x = 0;
  for (int i = 0; i < n; ++i) {
    E += 1;
    int left = (x + 1 + n - k) % n;
    int right = (x + k - 1) % n;
    int inters = 0;
    if (left < right) {
      inters += tree.GetSum(left, right);
    } else {
      inters += tree.GetSum(left, n - 1);
      inters += tree.GetSum(0, right);
    }
    E += 2 * inters;
    V += inters;
    printf("%I64d ", 1 + E - V);
    tree.Add(x, x, 1);
    x += k;
    if (x >= n) {
      x -= n;
    }
  }
  printf("\n");
  return 0;
}
