/* package whatever; // don't place package name! */
import java.util.*;
import java.lang.*;
import java.io.*;
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
{
Scanner scanner
= new Scanner
( System.
in ); int num = scanner.nextInt();
int sum = 0;
int temp = num;
while( true )
{
int digit = temp % 10;
sum += digit;
numAsSum = digit + numAsSum;
temp /= 10;
if( temp == 0 )
{
break;
}
numAsSum = "+" + numAsSum;
}
System.
out.
println( "Сума цифр " + numAsSum
+ " = " + sum
); String[] hundreds
= {"",
"сто",
"двісті",
"триста",
"чотириста",
"п'ятсот",
"шістсот","сімсот","вісімсот","дев'ятсот"};
String[] tens
= {"",
"",
"двадцять",
"тридцять",
"сорок",
"п'ятдесят",
"шістдесят","сімдесят","вісімдесят","дев'яносто"};
String[] ones
= {"",
"один",
"два",
"три",
"чотири",
"п'ять",
"шість",
"сім",
"вісім","дев'ять","десять","одинадцять","дванадцять",
"тринадцять","чотирнадцять","п'ятнадцять","шістнадцять",
"сімнадцять","вісімнадцять","дев'ятнадцять"};
String str
= hundreds
[ num
/100 ] + " " + tens
[ (num
/10)%10
] + " " + ones
[ num
%100
<20?num
%20
:num
%10
]; }
}
LyogcGFja2FnZSB3aGF0ZXZlcjsgLy8gZG9uJ3QgcGxhY2UgcGFja2FnZSBuYW1lISAqLwoKaW1wb3J0IGphdmEudXRpbC4qOwppbXBvcnQgamF2YS5sYW5nLio7CmltcG9ydCBqYXZhLmlvLio7CgovKiBOYW1lIG9mIHRoZSBjbGFzcyBoYXMgdG8gYmUgIk1haW4iIG9ubHkgaWYgdGhlIGNsYXNzIGlzIHB1YmxpYy4gKi8KY2xhc3MgSWRlb25lCnsKCXB1YmxpYyBzdGF0aWMgdm9pZCBtYWluIChTdHJpbmdbXSBhcmdzKSB0aHJvd3MgamF2YS5sYW5nLkV4Y2VwdGlvbgoJewoJCVNjYW5uZXIgc2Nhbm5lciA9IG5ldyBTY2FubmVyKCBTeXN0ZW0uaW4gKTsKCQlpbnQgbnVtID0gc2Nhbm5lci5uZ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