Sign
Time limit1sMemory limit1024 MB
Given three prices, print the sign text in input order, writing a shared digit once with an apostrophe when one price ends in the digit the next price starts with.
- Level
Easy2 of 10
- Topics
- Implementation, String
- Solved
- No attempts yet
Statement
In November, a shopping mall had few customers, so the sales clerks played a game: they took three goods and made a sign with their total price.
To shorten the total price, they agreed that if the last digit of one price is the same as the first digit of the next price, they write that digit only once and add an apostrophe (') to mark the repetition.
For example, with prices 13, 17 and 72, the total price is 1317'2, and the sign looks like this:

At the end of the day, the sign was decorated with markers and sequins:

You are a competitive programmer walking through the mall. When you see the sign, you decide to write a program named sign that finds the text on the sign from the three prices.
Input
The first line of standard input contains three natural numbers cena1, cena2 and cena3, the prices of the three goods. The numbers are separated by single spaces. The prices are given in the order they are entered, and the order must not change.
Output
Print one line to standard output: the text on the sign. The prices are written on the sign in the order they were entered.