Homework#2701

Homework

1 second
64 megabytes
Very easy

Little boy Vanya was given the following task at the number systems club: to convert the number from base s_1 to base s_2. Without thinking much, he called for help from his best friend Petya, who was famous for counting up to on his fingers. After several sleepless nights, together, they solved the problem.

Input

The input contains numbers: the initial number and the bases of the number systems s_1 and s_2 (2 \leq s_1, s_2 \leq 10). The number in the decimal system does not exceed 2\cdot10^9.

Output

The output should be a single number, which is represented in base s_2, or if the input data is invalid.

Examples

Example 1

Loading
Loading