#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
string strUnit[4] = {"thousand", "million", "billion"};
string strCount[] = {"zero", "one", "two", "three", "four", "five", "six", "seven", "eight",
"nine", "ten", "eleven", "twelve", "thirteen", "fourteen", "fifteen",
"sixteen", "seventeen", "eighteen", "nineteen", "twenty"};
string strBig[] = {"thirty", "forty", "fifty", "sixty", "seventy", "eighty", "ninety"};
string parse(long num)
{
string strRet;
if (num < 0)
{
return "error";
}
vector<int> vtBit;
// 提取出每一位
int nBit = 0;
do
{
nBit = num % 10;
vtBit.push_back(nBit);
num = num / 10;
}
while (num != 0);
// 逆序
reverse(vtBit.begin(), vtBit.end());
// 计算有多少个分节,三位数一个分节,比如123,456,789
int nSplit = vtBit.size() / 3;
if (vtBit.size() % 3 != 0)
{
nSplit += 1;
}
for (int i=nSplit, index=0; i>=1; i--)
{
int nCount = 3;
if (i == nSplit)
{
// 需要判断有几位数字
nCount = vtBit.size() - (nSplit - 1) * 3;
}
vector<int> vtTmp;
for (int j=0; j<nCount; j++)
{
vtTmp.push_back(vtBit[index++]);
}
//开始翻译每一节的数字
if (vtTmp.size() == 3)
{
//先翻译百位
if (vtTmp[0] != 0)
{
strRet += strCount[vtTmp[0]] + " hundred";
}
// 看个位和十位的数字
int nTmp = vtTmp[1] * 10 + vtTmp[2];
if (nTmp != 0)
{
if (vtTmp[0] != 0)
{
strRet += " and ";
}
if (nTmp <= 20)
{
strRet += strCount[nTmp];
}
else
{
strRet += strBig[vtTmp[1] - 3];
if (vtTmp[2] != 0)
{
strRet += " " + strCount[vtTmp[2]];
}
}
}
}
if (vtTmp.size() == 2)
{
// 看个位和十位的数字
int nTmp = vtTmp[0] * 10 + vtTmp[1];
if (nTmp <= 20 && nTmp != 0)
{
strRet += strCount[nTmp];
}
else
{
strRet += strBig[vtTmp[0] - 3];
if (vtTmp[1] != 0)
{
strRet += " " + strCount[vtTmp[1]];
}
}
}
if (vtTmp.size() == 1)
{
strRet += strCount[vtTmp[0]];
}
// 判断单位
if (i != 1)
{
strRet += " " + strUnit[i - 2] + " ";
}
}
return strRet;
}
int main(int argc, char **argv)
{
long num = 0;
while (cin >> num)
{
cout << parse(num) << endl;
}
return 0;
}