프로그램 명: coci_recenice
제한시간: 1 초

[요약] $가 포함된 문장이 주어지면 $에 수를 넣어서 총 글자 수(공백 제외)가 그 수가 되게 하여라.

예를 들어, this sentence has thirtyone letters 에 있는 글자 수는 31개(thirtyone)이다. 답이 여러 개이면 가장 작은 수를 넣어야 합니다.


Once upon a time in a land far far away, inhabited only by math students, Iva and Vedran were discussing self-explanatory sentences. A part of these sentences is exactly one number and it is equal to the total number of letters in the sentence. Some examples are: “This sentence has thirtyone letters.”, “Blah blah seventeen”.

Little Jurica overheard his friends' conversation and decided to impress them with the amount of selfexplanatory sentences he knows by heart. He rushed back home and wrote a programme which will, given a sentence, tell him the minimum number he can put inside so that the sentence is valid. Unfortunately, his computer broke and now he needs your help. Write a programme to help Jurica!

The form of the sentence is: word1 word2 word3 … $ word_n-1 word_n. The character $ represents the place where the number should be put in.

For example, the form of the sentence “this sentence has thirtyone letters” would be “this sentence has $ letters”. The rules that apply to writing numbers are the following:

Examples of naming some numbers:

입력

출력

The first and only line of output must contain the required sentence. The numbers are named as mentioned before, even if the sentence sounds gramatically incorrect.

The input data will be such that a solution will always exist and is less than 1000.

입출력 예

input

5
this
sentence
has
$
letters

output

this sentence has
thirtyone letters

input

7
$
is
the
number
of
letters
here

output

thirty is the number
of letters here

input

5
the
letters
are
$
potato

output

the
letters
are
twentynine
potato

Clarification of the second example: Sentence is split in two lines because of the lack of space in the
table. The total number of letters in the sentence is 6 + 2 + 3 + 6 + 2 + 7 + 4 = 30
Clarification of the third example: As you can see, this sentence is gramatically incorrect.
Nevertheless, Jurica is not concerned by that, for he is a mathematician, not a linguist.
출처:coci/2013-2014/contest3 3/6
요약:Cauchy

[질/답] [제출 현황] [푼 후(0)]
[ 채 점 ] [홈으로]  [뒤 로]