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

Задача 38264. Telegrams Matroskin


Задача

Темы: Строки
When Uncle Fyodor went home to the city, Matroskin and Sharik remained in charge of the household. But since Uncle Fyodor was very worried about the affairs in Prostokvashino, they agreed that every week Matroskin would write a letter with a report on the affairs. Pretty soon Matroskin realized that the letters were taking too long, so he decided to send telegrams. Usually the reports are very long, so Matroskin had to send several telegrams. To make it easier for Uncle Fyodor to understand the incoming telegrams, Matroskin follows the following rules:

Each telegram should contain no more than 140 characters, including spaces and punctuation.
The source text must be split into telegrams by spaces, while the space at which the telegram is split is destroyed.
If the telegram is not the last one, add three dots to the end of it.
If the telegram is not the first, add three dots to its beginning.
To save money on sending telegrams, Matroskin wants to split the text into as few as possible.

Help Matroskin split the source text into as few telegrams as possible according to the above rules.

Input
The input is a string of small Latin letters and spaces. It does not start or end with spaces, and no two spaces can be consecutive. The length of the string does not exceed 10000.

Imprint
In the first line print the number N – the number of telegrams into which the original string should be split. In the next N lines print the telegrams themselves. If it is impossible to pass the text in the given way, print −1.

 
Examples
# Input Output
1 deesecnj vmguhee xhled rrr dfjhj fdytiaf baulvovt kvhygzhv wfaocftf scugmcqsk wadi bjeiq coesxqgnry tmlko gpmwns rcf dtdey bvirmlv gzl bwuoio 2
deesecnj vmguhee xhled rrr dfjhj fdytiaf baulvovt kvhygzhv wfaocftf scugmcqsk wadi bjeiq coesxqgnry tmlko gpmwns rcf dtdey bvirmlv gzl...
...bwuoio