Pikachu had an array with him. He wrote down all the non-empty subsequences of the array on paper. Note that an array of size n has 2^{n} - 1 non-empty subsequences in it. 

Pikachu being mischievous as he always is, removed all the subsequences in which Maximum_element_of_the_subsequence  -  Minimum_element_of_subsequence  ≥ d

Pikachu was finally left with X subsequences. 

However, he lost the initial array he had, and now is in serious trouble. He still remembers the numbers X and d. He now wants you to construct any such array which will satisfy the above conditions. All the numbers in the final array should be positive integers less than 10^18. 

Note the number of elements in the output array should not be more than 10^4. If no answer is possible, print  - 1.


-----Input-----

The only line of input consists of two space separated integers X and d (1 ≤ X, d ≤ 10^9).


-----Output-----

Output should consist of two lines.

First line should contain a single integer n (1 ≤ n ≤ 10 000)— the number of integers in the final array.

Second line should consist of n space separated integers — a_1, a_2, ... , a_{n} (1 ≤ a_{i} < 10^18).

If there is no answer, print a single integer -1. If there are multiple answers, print any of them.


-----Examples-----
Input
10 5

Output
6
5 50 7 15 6 100
Input
4 2

Output
4
10 100 1000 10000


-----Note-----

In the output of the first example case, the remaining subsequences after removing those with Maximum_element_of_the_subsequence  -  Minimum_element_of_subsequence  ≥ 5 are [5], [5, 7], [5, 6], [5, 7, 6], [50], [7], [7, 6], [15], [6], [100]. There are 10 of them. Hence, the array [5, 50, 7, 15, 6, 100] is valid.

Similarly, in the output of the second example case, the remaining sub-sequences after removing those with Maximum_element_of_the_subsequence  -  Minimum_element_of_subsequence  ≥ 2 are [10], [100], [1000], [10000]. There are 4 of them. Hence, the array [10, 100, 1000, 10000] is valid.

Difficulty: competition

Starter code:

Solutions:
X, D = list(map(int, input().split()))
cn = 1
add0 = 1 if (X&1) else 0
ans = []
for i in range(30,0,-1):
	if not (X & (1<<i)): continue
	ans += [cn]*i
	add0 += 1
	cn += D
for i in range(add0):
	ans.append(cn)
	cn += D
print(len(ans))
print(' '.join(map(str, ans)))


x, d = list(map(int, input().split()))
arr = []
n = 0
s = ''
while x > 0:
    s += str(x % 2)
    x //= 2
f = 1
l = 999999999999999999
for i in range(len(s)):
    if int(s[i]):
        arr += [f] * i + [l]
        f += d
        l -= d
        n += i + 1
if n == -1:
    print(-1)
else:
    print(n)
    print(*arr)






x, d = map(int, input().split())

A = []
a = 1
k = 0
while a < x:
    a *= 2
a //= 2
x = bin(x)[2:][::-1]
y = 1
for i in range(len(x)-1, -1, -1):
    if x[i] == '1':
        A += (i) * [y]
        k += 1
    y += d+1

while k:
    A.append(y)
    y += d+1
    k -= 1

print(len(A))
for i in A:
    print(i, end=' ')


X, d = map(int, input().split())
a = list()
cur = 1
for i in range(32):
    if X&(1<<i):
        for j in range(i):
            a.append(cur)
        cur = cur+d
        a.append(cur)
        cur = cur+d
print(len(a))
for i in a:
    print(i, end=" ")