The Bases Are Loaded#1376

The Bases Are Loaded

1 second
64 megabytes
Easy

Write a program to convert an integer from one base ( to ) to another base ( to ). Digits greater than are represented by uppercase Latin letters; for example, as , as .

Input

Each line of input contains three values. The first is the base of the given number, the second is the target base, and the third is the number itself. The number may contain digits (including uppercase Latin letters for digits above ) that are invalid for the provided base. The number will contain at most characters. Each line's values are separated by at least one space.

Output

For each case, output the original number, a space, the word , a space, the original base, a space, , a space, the converted number, a space, , and a space, the target base. If the number is not valid in the original base, output:

\text{original\_number}\ \textbf{is an illegal base}\ \text{original\_base}\ \textbf{number}

Examples

Example 1

Loading
Loading