#abc288g. [abc288_g]3^N Minesweeper
[abc288_g]3^N Minesweeper
Problem Statement
There is zero or one bomb at each of positions .
Let us say that positions and are neighboring each other if and only if the following condition is satisfied for every .
- Let and be the -th lowest digits of and in ternary representation, respectively. Then, .
It is known that there are exactly bombs in total at the positions neighboring position . Print a placement of bombs consistent with this information.
Constraints
- There is a placement of bombs consistent with .
- All values in the input are integers.
Input
The input is given from Standard Input in the following format:
Output
Print with spaces in between, where if position has no bomb and if position has a bomb.
Sample Input 1
Sample Output 1
Position is neighboring positions and , which have bombs in total.
Position is neighboring positions , , and , which have bomb in total.
Position is neighboring positions and , which have bombs in total.
If there is a bomb at only position , all conditions above are satisfied, so this placement is correct.