num1 = ['zero','one','two','three','four','five','six',
'seven','eight','nine','ten','eleven','twelve',
'thirteen','fourteen','fifteen','sixteen',
'seventeen','eighteen','nineteen']
num2 = [0,0,'twenty','thirty','forty','fifty','sixty',
'seventy','eighty','ninety']
ListWords = []
def SumHundred(data): #计算1-99
if 0 < data <= 19:
ListWords.append(num1[data]) # 0-19都是可以只用用num1数组进行转换
elif 20 <= data <= 99:
ListWords.append(num2[data//10]) # 在100以内,先判断十位取值
if data % 10: # 如果10位取值后,还有个位数不为0,需要继续取值到各位
ListWords.append(num1[data % 10]) # 对10取余,则最大只有1-9
def SumThousand(data): #计算100-999
if 100 <= data <= 999:
ListWords.append(num1[data//100]) # 确认下有几百
ListWords.append("hundred")
if data % 100: # 如果还有十位和个位,则调用函数处理
ListWords.append("and")
SumHundred(data%100)
while True:
try:
InputNum = int(input())
BillionFlag = (InputNum // 1000000000) % 1000 # 统计1000000000-999999999999
MillionFlag = (InputNum // 1000000) % 1000 # 统计1000000-999999999
ThousandFlag = (InputNum // 1000) % 1000 # 统计1000-999999
HundredFlag = InputNum % 1000 # 统计1-999
# 输入111,111,111,111
# print(BillionFlag, MillionFlag, ThousandFlag, HundredFlag)
if BillionFlag: # 输出 one hundred and eleven billion
SumThousand(BillionFlag)
ListWords.append("billion")
if MillionFlag: # 输出 one hundred and eleven million
SumThousand(MillionFlag)
ListWords.append("million")
if ThousandFlag: # 输出 one hundred and eleven thousand
SumThousand(ThousandFlag)
ListWords.append("thousand")
if HundredFlag: # 输出 one hundred and eleven
SumThousand(HundredFlag)
# print(ListWords)
print(" ".join(ListWords))
except:
break