A combination dial displays a non-negative integer using positional notation. Digit values from 0 to 35 are written as the characters 0-9 then A-Z (so A means ten, Z means thirty-five). Given the value written in a source base and a target base, output the same value written in the target base, using uppercase letters, with no leading zeros (except the single digit 0 for the value zero).
Input format
Line 1: two integers from_base and to_base.
Line 2: the value written in from_base (uppercase letters for digit values of 10 or more).
Output format
A single line: the value written in to_base.
Constraints
- 2 <= from_base <= 36
- 2 <= to_base <= 36
- The input string has 1 to 40 characters and is a valid representation in
from_base.