Олимпиадный тренинг

Задача 38848. Number


Vasya wrote a large number on a long strip of paper and decided to show off this achievement to his older brother Petya. But as soon as he left the room to call his brother, his sister Katya ran into the room and cut a strip of paper into several pieces. As a result, one or more consecutive numbers appeared on each part.

Now Vasya cannot remember exactly what number he wrote. Just remember that it was very big. To console his younger brother, Petya decided to find out what the maximum number could be written on a strip of paper before cutting. Help him!

Input
The input consists of one or more lines, each containing a sequence of digits. The number of lines does not exceed 100, each line contains from 1 to 100 digits. It is guaranteed that the first digit in at least one line is different from zero.
The last line of the input stream contains the number -1 - a sign of the end of the data.

Imprint
Output a single line – the maximum number that could be written on the strip before cutting.
 
Examples
# Input Output
1 2
20
004
66
-1
66220004
2 3
-1
3