ENG  RUSTimus Online Judge
Online Judge
Online contests
About Online Judge
Frequently asked questions
Site news
Problem set
Submit solution
Judge status
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests

1428. Jedi Riddle

Time limit: 1.0 second
Memory limit: 64 MB


System administrator Vasily Slipman, also known as Jedi Master, was an outstanding jester. He enciphered gigabyte archive with... Not with cartoon films for children, of course. Well, you have already understood with what. To cut a long story short, Vasily enciphered the archive using a key formed by six unknown numbers, and then he died. Strange inscriptions written by the decedent were found on the surface of his computer’s case. These inscriptions may cast light on the origin of those six numbers which are so essential for people.
It appeared that the greatest human Sins in Mr. Slipman’s opinion are Fear, Anger and Hatred. By the way, nothing was said about terrorism. Hence the greatest human Virtues are Valor, Calmness and Love. Vasily assigned a special Number to each of the Sins and the Virtues. The Numbers of the Sins were found, and now the time has come to calculate the Numbers of the Virtues.


Let us denote the Number of Fear as A, the Number of Anger as B, the Number of Hatred as C, the Number of Valor as X, the Number of Calmness as Y and the Number of Love as Z. Mr. Slipman chose the Numbers A, B and C so that C-1 is divisible both by A and B, i.e. (C-1) modulo A = (C-1) modulo B = 0. You are to find the integer Numbers X, Y and Z in order to satisfy the following strange equation: X^A + Y^B = Z^C. The inscriptions tell us that X, Y and Z should not be less than 1 and more than 10^50. It was the will of the decedent.


The only line contains the integer Numbers A, B and C (1 ≤ A, B, C ≤ 32).


You should output the desired Numbers X, Y and Z. Each Number should be printed in a separate line. If the problem has several solutions, you should output any of them.


2 2 3
Problem Author: Ilya Grebnov, Dmitry Kovalioff, Nikita Rybak
Problem Source: Timus Top Coders: First Challenge