There are people standing in a line, numbered from to . The liars form exactly one nonempty contiguous segment. In other words, there exist integers such that exactly the people numbered are liars.
Person claims that at least one person numbered from to is a liar.
Every liar makes a false claim, and every person who is not a liar makes a true claim.
Find one liar segment consistent with all current claims. If no such segment exists, determine that it is impossible.
The claims are changed several times. After every change, print an answer for the current claims.
Input
The input is given from Standard Input in the following format:
Each case is given in the following format:
In the -th change, person changes their claim to say that at least one person numbered from to is a liar. That is, is replaced by .
Output
After every change in every test case, print one line.
If no liar segment is consistent with the current claims, print -1.
Otherwise, print two integers and separated by a space. They must satisfy , and every claim must have the required truth value when exactly the people numbered from to are liars.
If there are multiple solutions, print any of them.
Constraints
- .
- .
- .
- ().
- ().
- ().
- The sum of over all test cases does not exceed .
Subtasks
Samples
After the first change, no liar segment satisfies all conditions.
After the second change, person alone can be the liar. The same segment remains valid after each of the next two changes.