#include<bits/stdc++.h>
#include <math.h>
using namespace std;
#define MOD 1000000007
#define MAX 2010
#define ll long long
#define slld(t) scanf("%lld",&t)
#define sd(t) scanf("%d",&t)
#define sld(t) scanf("%ld",&t)
#define pd(t) printf("%d\n",t)
#define plld(t) printf("%lld\n",t)
#define pcc pair<char,char>
#define pp pair<int,int>
#define pll pair<ll,ll>
#define tr(container,it) for(typeof(container.begin()) it=container.begin();it!=container.end();it++)
#define mp(a,b) make_pair(a,b)
#define F first
#define S second
#define pb(x) push_back(x)
vector <ll> ans;
int main()
{
ll n,k;
slld(n); slld(k);
if(k>n/2)
{
k = n-k;
}
ll cur = 1+k;
ll an = 2; ll p = 1;
ans.pb(2LL);
for( int i=2; i<=n; i++)
{
cur += k;
if(cur>n)
{
cur %= n;
p++;
an+=p;
p++;
ans.pb(an);
}
else
{
an += p;
ans.pb(an);
}
}
for( int i=0; i<ans.size(); i++)
{
if(i==ans.size()-1)
{
ans[i] -= 1;
}
cout<<ans[i]<<" ";
}
}
I2luY2x1ZGU8Yml0cy9zdGRjKysuaD4KI2luY2x1ZGUgPG1hdGguaD4KdXNpbmcgbmFtZXNwYWNlIHN0ZDsKCiNkZWZpbmUgTU9EIDEwMDAwMDAwMDcKI2RlZmluZSBNQVggMjAxMAojZGVmaW5lIGxsIGxvbmcgbG9uZwojZGVmaW5lIHNsbGQodCkgc2NhbmYoIiVsbGQiLCZ0KQojZGVmaW5lIHNkKHQpIHNjYW5mKCIlZCIsJnQpCiNkZWZpbmUgc2xkKHQpIHNjYW5mKCIlbGQiLCZ0KQojZGVmaW5lIHBkKHQpIHByaW50ZigiJWRcbiIsdCkKI2RlZmluZSBwbGxkKHQpIHByaW50ZigiJWxsZFxuIix0KQojZGVmaW5lIHBjYyBwYWlyPGNoYXIsY2hhcj4KI2RlZmluZSBwcCBwYWlyPGludCxpbnQ+CiNkZWZpbmUgcGxsIHBhaXI8bGwsbGw+CiNkZWZpbmUgdHIoY29udGFpbmVyLGl0KSBmb3IodHlwZ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