#include <iostream>
#include <vector>
using namespace std;
vector< string> under20 = { "Zero" , "One" , "Two" , "Three" , "Four" , "Five" ,
"Six" , "Seven" , "Eight" , "Nine" , "Ten" ,
"Eleven" ,"Twelve" , "Thirteen" , "Fourteen" , "Fifteen" ,
"Sixteen" , "Seventeen" , "Eighteen" , "Nineteen" , "Twenty" } ;
vector< string> tens = { "Zero" , "Ten" , "Twenty" , "Thirty" , "Forty" , "Fifty" ,
"Sixty" , "Seventy" , "Eighty" , "Ninety" } ;
string numBelow1000( int num) {
if ( num == 0 ) return under20[ 0 ] ;
string ret = "" ;
if ( num > 100 ) {
ret = under20[ num/ 100 ] + " Hundred" ;
num % = 100 ;
if ( num == 0 ) {
return ret;
} else {
ret + = " and " ;
}
}
if ( num <= 20 ) {
ret + = under20[ num] ;
} else {
ret + = tens[ num/ 10 ] ;
num % = 10 ;
if ( num > 0 )
ret + = " " + under20[ num] ;
}
return ret;
}
string num2string( int num) {
int part1 = num / 1000 ;
int part2 = num % 1000 ;
string res;
if ( part1) {
res = numBelow1000( part1) + " Thousand" ;
if ( part2) res + = ", " + numBelow1000( part2) ;
} else {
res = numBelow1000( part2) ;
}
return res;
}
int main( ) {
int num = 0 ;
cin >> num;
string rs = num2string( num) ;
cout << rs<< endl;
return 0 ;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgp1c2luZyBuYW1lc3BhY2Ugc3RkOwoKdmVjdG9yPHN0cmluZz4gdW5kZXIyMCA9IHsiWmVybyIsICJPbmUiLCAiVHdvIiwgIlRocmVlIiwgIkZvdXIiLCAiRml2ZSIsIAoJCSJTaXgiLCAiU2V2ZW4iLCAiRWlnaHQiLCAiTmluZSIsICJUZW4iLAoJCSJFbGV2ZW4iLCJUd2VsdmUiLCAiVGhpcnRlZW4iLCAiRm91cnRlZW4iLCAiRmlmdGVlbiIsCgkJIlNpeHRlZW4iLCAiU2V2ZW50ZWVuIiwgIkVpZ2h0ZWVuIiwgIk5pbmV0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