Elementary Math

Assign +, -, or * to each of n given pairs so all results differ, choosing the lexicographically smallest valid assignment.

Medium7GraphGreedyNo attempts yetTime limit10sMemory limit256 MB

Problem

Ellen teaches elementary math and the final exam is coming up. The exam has nn questions. In each question a student adds (+), subtracts (-), or multiplies (*) a pair of integers.

Ellen has already picked the nn pairs. What is left is deciding which operation goes with each pair. So the students do not get bored, all nn results must be different.

Help Ellen prepare the exam.

Input

The first line contains the number of pairs nn (1n25001 \le n \le 2500).

Each of the next nn lines contains the two integers aa and bb of one pair, separated by a space (106a,b106-10^6 \le a, b \le 10^6).

Output

If an assignment exists, print nn lines in the same order as the input. Line ii has the form a op b = c, where op is one of +, -, * and c is the result of that operation. Separate the parts with single spaces. The nn results must all be different.

Several assignments can satisfy this, so print exactly one of them. Read the chosen operators in input order as a string and print the assignment whose string is smallest in the order +, -, *. Equivalently, go pair by pair from the first one and use + whenever the remaining pairs can still be given distinct results, otherwise -, otherwise *.

If no assignment makes the nn results different, print impossible.