eolymp
bolt
Try our new interface for solving problems
Problems

Twigs and bumps

Twigs and bumps

\textit{Bear-toed through the forest goes,} \textit{Cones collects and puts in his pocket ...} \textit{(Children's song)} Bear not only collected bumps, it besides on the way home yet, and breaks off the crimson stalks. Tasty raspberries bear immediately gladly ate and twigs gathered into a bouquet for Masha - he invented for her a new game with branches and knobs. Branches he laid out on the sand among and between them knobs signs of addition, subtraction, multiplication, division and equality. Mischa examples sometimes lecturing correctly, and sometimes specially made ​​mistakes, but in any case, he gave the girl the job the following type: \textit{- Masha, and if you can, shifting only }\textit{\textbf{K}}\textit{ twigs and not touching shishechek get the correct equation? Do not forget here that each branch can be shifted only once, and the freed-up another branch lozhit anymore.} Masha very quickly learned to solve Mishka examples and is now offering them to you. \InputFile The first line set to the number of examples, exercises Misha \textbf{T} (\textbf{1} ≤ \textbf{T} ≤ \textbf{250}). In the following \textbf{T} lines themselves examples, one per line in the format <\textbf{number}> <\textbf{operation}> <\textbf{number}> <\textbf{equality}> <\textbf{number}> (\textbf{K}) - see the example input data. All of the examples do not exceed \textbf{2^31}. Leading zeros in the numbers allowed. When the image numbers Misha used the following location and number of branches at a Glance: \includegraphics{https://static.e-olymp.com/content/4d/4d37100b8f460a8cd42dfc83df5ab836b073b01d.jpg} \OutputFile Print the \textbf{T} line with the decision of each test case. In the case of several output any decisions. If the sample is impossible to solve, display the astonished exclamation Masha "\textbf{Oooops...}" (without the quotes).
Time limit 4 seconds
Memory limit 64 MiB
Input example #1
3
6 + 1 = 12 (1)
81 * 8 = 1 (3)
5 - 1 = 4 (1)
Output example #1
5+7=12
01*3=3
Oooops...
Source Team Cup Ukraine 2011 - schoolchildren - Round 1