#2663 Talking Money

1 s   128 MB  

Description

The company you work for, Automatic Conversation Machina, a text to speech service provider, has just won a contract for a telephone banking system. Unfortunately their text to speech software does not yet work with numerical values like the balance in a bank account. They need you to take a currency value and convert that to words so the software will be fully functional for the telephone banking system.

The conversion must work for values between negative $999 999 999 999.99 and positive $999 999 999 999.99. None of the bank’s customers are trillionaires just yet.

The value must be fully converted to words for all parts of the currency amount including the cents amount i.e. zero dollars and zero cents are to be included if the dollar or cents value are zero, respectively. The following rules must be observed:

The correct spelling for all values likely to be needed are: zeroonetwothreefourfive,sixseveneightnineteneleventwelvethirteenfourteenfifteensixteen,seventeeneighteennineteentwentythirtyfortyfiftysixtyseventyeighty,ninetyhundredthousandmillionbillion.

Input

The input contains a single test case.

The input will consist of one currency value v (−$999 999 999 999.99 ≤ v ≤ $999 999 999 999.99).

Output

The output for the test case must be on a single line with a single space between each word. Note: The sample output is displayed over multiple lines so that it fits on the page.

Sample Input

Sample Output

-$123456789012.34
one hundred and twenty-three billion four hundred and fifty-six million seven hundred and eighty-nine thousand and twelve dollars and thirty-four cents in debit

Source

ACM South Pacific Western Division 2015 F, ACM South Pacific Eastern Division 2015 B