Division#7409

Division

1 second
64 megabytes
Hard

Given two numbers and in the -ary numeral system, where it is known that is divisible by , your task is to determine the last digits of the quotient when is divided by , also expressed in the -ary numeral system.

Input

The first line contains a positive integer , represented in the -ary numeral system. This number can have up to one million digits. In this system, digits to represent themselves, while uppercase letters to represent digits to . The number does not have leading zeros.

The second line contains the number , formatted similarly to .

It is guaranteed that is divisible by without any remainder.

The third line contains the integer (1 \leq k \leq 10^4).

Output

Print exactly digits in the -ary numeral system, representing the last digits of the quotient. If the quotient has fewer than digits, prepend it with leading zeros. All letters in the output should be uppercase.

Examples

Example

Input
8U
2
2
Output
44

Example

Input
9
2
1
Output
4

Example

Input
U
7
4
Output
0002

Example 1

Loading
Loading