Write a program that converts a number from one numeral system to another. The program should take three inputs: , , and . Here, and are natural numbers ranging from to , representing the bases of the numeral systems. is a number expressed in the numeral system with base , where 0 < A < 2^{31}.
The task is to output the value of in the numeral system with base , ensuring there are no leading zeros. The digits are represented by the symbols: '0', '1', '2', ..., '9', 'A', 'B', 'C', ..., 'Z'.
The input file consists of lines: The first line contains the number , where 2 \leq n \leq 36. The second line contains the number , which is written in the numeral system with base , and satisfies 0 < A < 2^{31}. The third line contains the number , where 2 \leq k \leq 36.
Output the number expressed in the numeral system with base .
Example 1