After saving the world, PokéTrainer Little Joseph has nothing to do and wants to test out your programming skills, and hence you have been asked to solve this PokéTest problem set by Little Joseph.

Little Joseph will give you two integers x and y and his desired base b, and he wants to do something weird to these two integers. He wants you to convert x and y into base b then add them up in that base. However, he does not allow you to carry over the number when you add.

For example, if x = 29, y = 33 and b = 5,

Little Joseph wants you to convert x and y into base 5 to get x = 104 (b5) and y = 113 (b5).

Adding them normally would give 222 by first adding 4 and 3 to get 125, then carry over the 1 to the next place value to add to 0 + 1 to give 2. However, if carrying over is disallowed, the 1 carried over from the 4+3 will not be counted, and hence the addition for the second place value would not include the extra 1. It will be instead:

+ 113
212 ← The 1 does not carry over, so the second place value is just merely 0 + 1

Your task as a PokéProgrammer is to fulfil Little Joseph's weird wishes and output the answer using Little Joseph's weird addition method in base b.


Three integers, x, y and base b where x, y ≤ 2147483647 and b ≤ 10


The answer with Little Joseph's addition in base b.

Sample Input

35 39 7

Sample Output


Submitting .cpp to 'pokeadd'

You're not logged in! Click here to login

Compile Errors

Time Limit: 1 Seconds
Memory Limit: 256MB
No. of ACs: 20
Your best score: 0
Source: Dunjudge Archive

Subtask Score
1 100
2 0