시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 128 MB71133.333%

문제

In the official British written word format for numbers, tens and units are separated by a hyphen, and hundreds are separated from tens or units by the word "and". For example the number 123 would be written "one hundred and twenty-three". Large numbers are written in "triads" (groups of three digits) followed by the appropriate suffixes. For example 123456 is "one hundred and twenty-three thousand four hundred and fifty-six". As a special case, if the final triad of a large number has a tens or units component but no hundreds component, it needs an "and". Thus 1001001 is "one million one thousand and one".

Your task is to write a program that produces correct British written format for numbers of up to 9 digits (less than one "short" billion). Note that the correct spellings are "fifteen" and "fifty" ('f' instead of 'v'), and "forty" (no 'u').

입력

Input will consist of specifications for a series of tests. Information for each test is a single line containing an integer 1 <= n < 1000000000 that specifies the value to process. A line containing the value 0 terminates the input.

출력

Output should consist of one line for each test comprising the test number (formatted as shown) followed by a single space and the correct British word form of the input value, with a single space between words.

예제 입력 1

123
1001001
900090009
0

예제 출력 1

Test 1: one hundred and twenty-three
Test 2: one million one thousand and one
Test 3: nine hundred million ninety thousand and nine