755_D. PolandBall and Polygon
PolandBall has such a convex polygon with n veritces that no three of its diagonals intersect at the same point. PolandBall decided to improve it and draw some red segments. 

He chose a number k such that gcd(n, k) = 1. Vertices of the polygon are numbered from 1 to n in a clockwise way. PolandBall repeats the following process n times, starting from the vertex 1: 

Assume you've ended last operation in vertex x (consider x = 1 if it is the first operation). Draw a new segment from vertex x to k-th next vertex in clockwise direction. This is a vertex x + k or x + k - n depending on which of these is a valid index of polygon's vertex.

Your task is to calculate number of polygon's sections after each drawing. A section is a clear area inside the polygon bounded with drawn diagonals or the polygon's sides.

Input

There are only two numbers in the input: n and k (5 ≤ n ≤ 106, 2 ≤ k ≤ n - 2, gcd(n, k) = 1).

Output

You should print n values separated by spaces. The i-th value should represent number of polygon's sections after drawing first i lines.

Examples

Input

5 2


Output

2 3 5 8 11 

Input

10 3


Output

2 3 4 6 9 12 16 21 26 31 

Note

The greatest common divisor (gcd) of two integers a and b is the largest positive integer that divides both a and b without a remainder.

For the first sample testcase, you should output "2 3 5 8 11". Pictures below correspond to situations after drawing lines.

<image> <image> <image> <image> <image> <image>
```python
import sys

inf = (1 << 31) - 1

def solve():
    n, k = map(int, input().split())

    if k > n - k:
        k = n - k

    bit = BinaryIndexedTree([0]*n)

    s = 0
    res = 1
    ans = []

    for i in range(n):
        t = (s + k) % n

        if s < t:
            res += bit.get_sum(t) - bit.get_sum(s + 1) + 1
            ans.append(res)
        else:
            res += bit.get_sum(n) - bit.get_sum(s + 1)
            res += bit.get_sum(t) + 1
            ans.append(res)

        bit.add(s, 1)
        bit.add(t, 1)

        s = t

    print(*ans)

class BinaryIndexedTree:
    ''' 1-origin Binary Indexed Tree '''

    def __init__(self, a):
        self.n = len(a)
        self.bit = [0]*(self.n + 1)

        for i in range(1, self.n + 1):
            self.bit[i] += a[i - 1]

            if i + (i & (-i)) <= self.n:
                self.bit[i + (i & (-i))] += self.bit[i]

    def add(self, i, x):
        ''' a_i += x '''
        i += 1 # 0-origin -> 1-origin

        while i <= self.n:
            self.bit[i] += x
            i += i & (-i)

    def get_sum(self, r):
        ''' sum(a[0 .. r)) '''
        res = 0

        while r > 0:
            res += self.bit[r]
            r -= r & (-r)

        return res

if __name__ == '__main__':
    solve()
```