Julia and Jeremy are twins who like to set each other challenges.
While learning about number systems they noticed that people use decimal, base 10, probably because we have ten fingers. So the twins imagined creatures with a different number of fingers or limbs, and decided to convert decimal numbers into the number systems those creatures would use.
The input holds several challenges. Each challenge takes three lines.
The first line is the description of a creature, which need not be a real one. It is at most 20 characters long. If the description starts with #, that challenge is not processed and the input ends there.
The second line is the number of digits or appendages the twins assume the creature counts with, which is the base of its number system. It is an integer between 2 and 20 inclusive.
The third line is the decimal number to convert into that base. It is a positive integer no greater than 5000.
Print one line per challenge. The line holds the description of the creature, a comma and a space, the decimal number, another comma and space, and then the converted number.
When the base is larger than 10, write the digits worth 10 or more as the upper case letters A to J in alphabetical order. Do not pad the converted number with leading zeros.
In decimal each place is worth 10 times the place to its right, so the place values are 1, 10, 100 and 1000. That makes 397 equal to 3×100+9×10+7.
Suppose a hexapus uses 16 digits, 0 to 9 and A to F. Each place is then worth 16 times the place to its right, so the place values are 1, 16, 256 and 4096.
For a hexapus, 18D means 1×256+8×16+D, and D is 13 in decimal, so the value is 256+128+13=397. This problem asks for the opposite direction: turn the decimal number 397 into 18D.