import java.util.Scanner;
public class A_008{
private static String[] Money_Unit = {"","拾","佰","仟","萬","拾","佰","仟","億","拾"};
private static String[] Capital = {"零", "壹", "貳", "參", "肆", "伍", "陸", "柒", "捌", "玖"};
public static void main(String[] args){
Scanner input = new Scanner(System.in);
int base = 0;
while(input.hasNext()){
String result = "";
try{
base = Math.abs(input.nextInt());
}catch(Exception e){
System.out.println("您已輸入過長的金額,將自動轉為2147483647");
base = 2147483647;
}
if(base>2147483646){
result="貳拾壹億肆仟柒佰肆拾捌萬參仟陸佰肆拾柒";
}else{
int Substitute = 0;
String String_Base = "";
String_Base = String.valueOf(base);
int String_Base_Length = 0;
String_Base_Length = String_Base.length();
boolean Zero = false;
boolean Change = false;
for(int i = 0 ; i < String_Base_Length ; i++){
Substitute = String_Base.charAt(i) - '0';
if(Substitute != 0){
if(Zero){
result += "零";
Zero = false;
}
Change = true;
result += Capital[Substitute] + "" + Money_Unit[String_Base_Length - i - 1];
}else{
Zero = true;
if(Change){
int index = String_Base_Length - i - 1;
if(index != 0 && index % 4 == 0){
result += Money_Unit[String_Base_Length - i - 1];
Change = false;
}
}
}
}
}
System.out.println(result);
}
}
}