#CSPJ2020A. 优秀的拆分 (Excellent Split)

优秀的拆分 (Excellent Split)

Description

Generally speaking, a positive integer can be split into the sum of several positive integers.

Example: 1=1,10=1+2+3+41 = 1, 10 = 1 + 2 + 3 + 4.

For a positive integer nn we call it excellent if and only if under this kind of separation, nn is broken down into several different numbers such that each number is a positive power of 22. Note that a number xx can be expressed as a positive power of 22, if and only if x=2kx = 2^k for some integer k1k \ge 1.

Example: 10=8+2=23+2110 = 8 + 2 = 2^3 + 2^1 is an excellent split. But, 7=4+2+1=22+21+207 = 4 + 2 + 1 = 2^2 + 2^1 + 2^0 is not an excellent split, because 11 is not 22 to the power of a positive integer.

Now, given a positive integer nn, you need to judge whether there is an excellent split among all the splits of this number. If so, please give a specific split plan.

Input Format

The input is only one line, an integer nn, that represents the number to be split.

Output Format

If there is an excellent split among all the splits of this number, then you need to output each number in this split from largest to smallest, separated by a space between two adjacent numbers. It can be proved that after the order of splitting numbers is specified, the splitting plan is unique.

If there is no excellent split, output -1.

6
4 2
7
-1

Constraints

For 20%20\% of the data, n10n \le 10.
For another 20%20\% of the data, nn is guaranteed to be odd.
For another 20%20\% of the data, nn is guaranteed to be a positive power of 22.
For 80%80\% of the data, n1024n \le 1024.
For 100%100\% of the data, 1n1071 \le n \le 10^7.