시간 제한 메모리 제한 제출 정답 맞은 사람 정답 비율
1 초 256 MB 19 13 12 66.667%

## 문제

Julia and Jeremy are twins who like to set each other challenges. Both have been learning about number systems, and are aware that we normally use decimal (base 10) numbers, probably because of the number of fingers we have.

The twins decided it would be fun to convert our numbers to number systems that other creatures may use, creatures who have a different number of digits or other appendages. See if you can rise to their challenge!

## 입력

Each challenge consists of 3 lines. The first line is a description of a creature (not necessarily real life). This will be no more than 20 characters in length. The final challenge begins with # - this challenge is not to be processed.

The second line of a challenge is the number of digits or appendages the twins assume the creature would use as a basis for its numbering system. This will be a number between 2 and 20 inclusive.

The final line is a decimal number which is to be converted into the assumed numbering system of the creature. This will be a positive integer no greater than 5,000

## 출력

Each challenge requires a single line of output. It consists of the name of the creature, followed by a comma and a space, followed by the decimal number, followed by another comma and space, followed by the converted number. As is usual, where a base larger than 10 is used, upper case letters of the alphabet (A to J, in alphabetical order) are used as extra digits.

## 예제 입력 1

Three toed sloth
6
27
Octopus
8
126
Hexapus
16
397
#


## 예제 출력 1

Three toed sloth, 27, 43
Octopus, 126, 176
Hexapus, 397, 18D


## 힌트

Explanation for Hexapus

In decimal numbers, each place represents 10x the value of the place to its right, so 1,000s, 100s, 10s and 1s. 397 is 3 x 100 + 9 x 10 + 7. The hexapus (whatever one of those is!) uses 16 digits, 0 to 9 and A to F. With 16 digits, the places are 16x the value of the place to its right, so 3,364s, 256s, 16s and 1s.

18D for a hexapus is 1 x 256 + 8 x 16 + D (which is 13 in decimal) which is 256 + 128 + 13 which is 397 in decimal numbers. In the problem, you have to work backwards and convert 397 decimal to 18D.
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 0, "mathjax_display_tex": 0, "mathjax_asciimath": 1, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0, "katex": 0, "math-container": 0, "wp-katex-eq": 0, "align": 0, "equation": 0, "x-ck12": 0, "texerror": 0, "math_score": 0.2262541949748993, "perplexity": 1268.048064220133}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 20, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "plain"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "warc_path": "s3://commoncrawl/crawl-data/CC-MAIN-2018-51/segments/1544376823550.42/warc/CC-MAIN-20181211015030-20181211040530-00526.warc.gz"}