Your friend recently gave you some slimes for your birthday. You have n slimes all initially with value 1.

You are going to play a game with these slimes. Initially, you put a single slime by itself in a row. Then, you will add the other n - 1 slimes one by one. When you add a slime, you place it at the right of all already placed slimes. Then, while the last two slimes in the row have the same value v, you combine them together to create a slime with value v + 1.

You would like to see what the final state of the row is after you've added all n slimes. Please print the values of the slimes in the row from left to right.


-----Input-----

The first line of the input will contain a single integer, n (1 ≤ n ≤ 100 000).


-----Output-----

Output a single line with k integers, where k is the number of slimes in the row after you've finished the procedure described in the problem statement. The i-th of these numbers should be the value of the i-th slime from the left.


-----Examples-----
Input
1

Output
1

Input
2

Output
2

Input
3

Output
2 1

Input
8

Output
4



-----Note-----

In the first sample, we only have a single slime with value 1. The final state of the board is just a single slime with value 1.

In the second sample, we perform the following steps:

Initially we place a single slime in a row by itself. Thus, row is initially 1.

Then, we will add another slime. The row is now 1 1. Since two rightmost slimes have the same values, we should replace these slimes with one with value 2. Thus, the final state of the board is 2.

In the third sample, after adding the first two slimes, our row is 2. After adding one more slime, the row becomes 2 1.

In the last sample, the steps look as follows:   1  2  2 1  3  3 1  3 2  3 2 1  4

Difficulty: competition

Starter code:

Solutions:
#!/usr/bin/env python3
n = int(input())
arr = []

for i in range(n):
    arr.append(1)
    while len(arr)>=2 and arr[-1] == arr[-2]:
        a, b = arr.pop(), arr.pop()
        arr.append(a+1)

print(' '.join(map(str, arr)))

3

import sys

n = int(sys.stdin.readline().rstrip())

A = []

for i in range(n):
    A.append(1)
    while len(A) >= 2 and A[-1] == A[-2]:
        A.pop()
        A[-1] += 1

print(" ".join(map(str, A)))


n = int(input())
slimes = list()
for _ in range(n):
    slimes.append(1)
    while len(slimes) > 1 and slimes[-1] == slimes[-2]:
        slimes.pop()
        slimes[-1] += 1
print(" ".join(map(str, slimes)))


a = []
for x in range(int(input())):
    a.append(1)
    while len(a) > 1 and a[-1] == a[-2]:
        a.pop()
        a.append(a.pop() + 1)
print(*a)


def main():
    n = int(input())
    a = []
    for i in range(n):
        a.append(1)
        while len(a) > 1 and a[-1] == a[-2]:
            a.pop()
            a[-1] += 1
    
    print(' '.join(str(i) for i in a))


main()

n = int(input())
arr = [1]
for i in range(1, n):
	arr.append(1)
	while (len(arr) > 1 and arr[-1] == arr[-2]):
		arr.pop()
		arr[-1]+=1
print(*arr)

n = int(input())
out = []
cur = 1
while n > 0:
    if n % 2 == 1:
        out.append(cur)
    cur += 1
    n //= 2
for v in reversed(out):
    print(v, end=' ')
print()


n = int(input())

L = []
for i in range(n):
    L.append(1)
    while len(L) >= 2 and L[-1] == L[-2]:
        L.pop()
        L[-1] += 1
print(' '.join(str(i) for i in L))


n = int(input())
p = []
while n != 0:
    while len(p) >= 2 and p[-2] == p[-1]:
        p[-2] += 1
        p.pop()
    p.append(1)
    n -= 1
while len(p) >= 2 and p[-2] == p[-1]:
        p[-2] += 1
        p.pop()
print(*p)
        


v = []
for i in range(int(input())):
    v.append(1)
    while (len(v) >= 2 and v[-1] == v[-2]):
        v.pop()
        v[-1] += 1
print(' '.join(map(str, v)))

N = int(input())
ans = []
i = 0
while N >> i:
    if (N >> i) & 1:
        ans.append(i+1)
    i += 1
print(*ans[::-1])


def get(k):
    find = False
    for i in range(len(k)):
        if k[i] == 0:
            k[i] = 1
            break
        else:
            k[i] = 0
    else:
        k.append(1)
    return k


n = int(input())
k = []
for i in range(n):
    k = get(k)
for i in range(len(k) - 1, -1, -1):
    if k[i]:
        print(i + 1, end=' ')



n = int(input())
l = []
for i in range(n):
    l.append(1)
    while len(l) > 1 and l[-1] == l[-2]:
        l.pop()
        l[-1] += 1
print(*l)

n = int(input())
s = bin(n)[2:]
num = len(s)
for f in s:
    if f == '1':
        print(num, end = ' ')
    num -= 1

def deep(n):
    if n != 0:
        i = 0
        while n > 2**i:
            i += 1
        if n == 2**i:
            print(i+1)
        else:
            print(i, end=' ')
            n -= 2**(i-1)
            deep(n)

n = int(input())
deep(n)


n = int(input())
power = [1] * 100
for i in range(1, 100):
    power[i] = power[i - 1] * 2
answer = []
a = 99
while n > 0:
    if n >= power[a]:
        n -= power[a]
        answer.append(a + 1)
    a -= 1
print(*answer)

n = int(input())

v = []
for i in range(n):
    v.append(1)

    while len(v) >= 2 and v[-2] == v[-1]:
        x = v.pop()
        v.pop()
        v.append(x+1)

print(' '.join([str(x) for x in v]))



n = int(input())

l = []

for i in range(n):
    l.append(1)
    while len(l) > 1 and l[-1] == l[-2]:
        x = l.pop()
        l[-1] += 1

for i in l:
    print(i, end = ' ')


import math
n = int(input())
ans = [x+1 for x in range(n.bit_length(), -1, -1) if (n>>x)&1]
for x in ans:
    print(x, end = ' ')


n = int(input())
while n != 0:
    a = 1
    k = 0
    while a <= n:
        a *= 2
        k += 1
    a //= 2
    print(k,end=' ')
    n -= a

n=int(input());v=[]
t=0;s=""
while (n!=0):
    s+=str(n%2)
    n//=2
for i in range(len(s)):
    if (s[i]=="1"):
        v.append(i+1)
for i in range(len(v)-1,-1,-1):
    print(v[i],end=" ")


n = int(input())
a = []
for i in range(n):
    a.append(1)
    while len(a) > 1 and a[len(a) - 1] == a[len(a) - 2]:
        a.pop()
        a[len(a) - 1] += 1
for i in a:
    print(i, end = ' ')

list=[0]
n=int(input())
for i in range(1,n+1):
    list.append(1)    
    while list[len(list)-1]==list[len(list)-2]:
        del list[len(list)-2]
        list[len(list)-1]+=1
for i in range(1,len(list)):
    print(list[i],end=' ')

    
    


l = [0] + list(reversed(bin(int(input()))))
for i in range(len(l)-2,0,-1):
    if l[i] == '1':
        print(i,end=' ')