#abc269c. [abc269_c]Submask
[abc269_c]Submask
Problem Statement
You are given a non-negative integer . Print all non-negative integers that satisfy the following condition in ascending order.
- The set of the digit positions containing in the binary representation of is a subset of the set of the digit positions containing in the binary representation of .
- That is, the following holds for every non-negative integer : if the digit in the "s" place of is , the digit in the s place of is .
Constraints
- is an integer.
- In the binary representation of , at most digit positions contain .
Input
The input is given from Standard Input in the following format:
Output
Print the answer as decimal integers in ascending order, each in its own line.
Sample Input 1
11
Sample Output 1
0
1
2
3
8
9
10
11
The binary representation of is .
The non-negative integers that satisfy the condition are:
Sample Input 2
0
Sample Output 2
0
Sample Input 3
576461302059761664
Sample Output 3
0
524288
549755813888
549756338176
576460752303423488
576460752303947776
576461302059237376
576461302059761664
The input may not fit into a -bit signed integer.