Statement
You are given an by grid . Each cell contains either or .
A shortest path from to moves one cell to the right or one cell downward at every step. Reading the characters on the visited cells from the start to the end produces a binary string of length .
The grid is called cool if two distinct shortest paths can produce the same binary string. Otherwise, equivalently, if every shortest path produces a different binary string, the grid is not cool.
Choose exactly distinct cells and flip each chosen cell once. A becomes , and a becomes .
Construct one grid that is not cool after exactly flips. If this is impossible, report that it is impossible.
Input
The input is given from Standard Input in the following format:
Each case is given in the following format:
is a binary string of length , and its -th character is the value of cell .
Output
For each test case, print the answer.
If no valid grid can be constructed, print -1 on one line.
Otherwise, print binary strings of length . The printed grid must differ from the original grid in exactly cells and must not be cool.
If there are multiple solutions, print any of them.
Constraints
- .
- .
- .
- (, ).
- The sum of over all test cases does not exceed .
Subtasks
Samples
In the second test case, flipping cell changes exactly one cell. In the third test case there is only one shortest path, so the printed grid also satisfies the requirement.