CODR - LOGIC

Mr.X  has recently graduated from his university.He was called for an interview by a company Y.In the coding round the company asked from Mr.X to decrypt a set of 3 digit numbers using some algorithm.Mr.X does not have very good programming skills,but he knows you as a friend and a talented programmer.Help Mr.X to get selected for the job.

Input

Each line of input consists of a 3 digit number. Inputs are terminated when 0 is encounterred.

Output

Ouput consists of a decrypted number for each input number.

Example

Input:
999
111
124
987
0
 Output:

8181261 010120 0208100 7256821

Added by:Abhishek Tiwari
Date:2013-02-24
Time limit:0.5s
Source limit:50000B
Memory limit:1536MB
Cluster: Cube (Intel G860)
Languages:All except: ASM64
Resource:own problem

hide comments
2013-02-26 08:10:20 Arika Saputro
i think it's not logic, but imagination ;D
2013-02-25 16:34:21 Pranay
unable to get why answer for 124 is 0208100 ..can only think of 020801 as per other test cases
2013-02-25 08:46:51 Arjit Srivastava
What will be the output for 127? Also, someone with more concrete examples? Also, the author, can you check what's wrong with my solution? As far as I know, it is working for possibly every single test case, and terminating, too. Er?
2013-02-24 18:08:23 Eduardo Nunes
my code returns 021681 for 128 and 160281 for 821... but i still get WA... is my logic right?
2013-02-24 15:14:12 figield
More examples, please. What should be return for 128 or 821.
2013-02-24 14:24:59 Jakub Gonzales deSousa Ropuszewicz
What is the correct answer for 128 ?
2013-02-24 13:01:45 yupp
more test case !!!!
2013-02-24 10:12:39 Francky
Answer for 124 should be 0204010 or 020401, but not 0204100, isn't it ? Maybe I'm wrong with my logic !?
EDIT : Got AC, my logic was wrong, I found why answer is well 0204100.

Last edit: 2013-02-24 10:29:47
2013-02-24 06:44:36 Mitch Schwartz
I'd prefer to see such problems on http://www.spoj.com/GUESS/ and not on the main site.
2013-02-24 04:10:22 Alex Anderson
This isn't a coding problem.
© Spoj.com. All Rights Reserved. Spoj uses Sphere Engine™ © by Sphere Research Labs.