| XIII UnB Contest Mirror |
|---|
| Finished |
Professor John was at sea, conducting research on marine fauna, when his boat, which was anchored at point $$$X$$$, was enveloped by a thick fog that interfered with both visibility and the boat's location sensors.
John and his team waited patiently for two days, but as there was no indication that the fog would lift and their supplies were running low, he decided they should search for land.
To avoid sailing aimlessly in a disoriented manner, the professor devised the following strategy:
It was a long and exhausting process, but the team succeeded and anchored on solid ground. After recovering, Professor John retrieved the record from his logbook, which stated that the total displacement of the boat was $$$D$$$ meters and the point where they found land was located at $$$Y$$$.
From this data, he intends to determine the point $$$X$$$ where they were initially anchored. However, given the physical and mental exhaustion from the experience, John may have made mistakes in his notes. Therefore, help determine whether the data is consistent or not, and if so, find the value of $$$X$$$.
The first line of the input contains the integer value $$$D$$$ $$$(1\leq D\leq 3\times 10^{18})$$$.
The second line of the input contains the integer value $$$Y$$$ $$$(-10^{18}\leq Y\leq 10^{18})$$$.
Print, on one line, the message "Sim" (without quotes) if Professor John's data is consistent, or the message "Nao" if it is not.
If the data is consistent, print on the second line the value of $$$X$$$, the point where the boat was initially anchored.
1010
Sim 6
52
Nao
401
Sim -9
4-3
Sim -1
In the first case, we have the following sequence of movements of the boat: the numbers in blue and the arrows indicate the total displacement to the indicated point, the numbers in black mark the positions, and the flag signals the beginning of solid ground.
In the second case, to reach point $$$2$$$ with a displacement of exactly $$$5$$$ meters, the boat should have been anchored at $$$X = 3$$$, and we would have the following situation:
Note that, as shown in the figure, if solid ground began at point $$$Y = 2$$$, the boat would have reached it when the total displacement recorded was $$$3$$$ meters, thus Professor John's record is inconsistent.
In the fourth case, note that both $$$X$$$ and $$$Y$$$ can be negative.
| Name |
|---|


