Back
Close

Way Too Long Words

Statement

 Goal

Sometimes some words like "localization" or "internationalization" are so long that writing them many times in one text is quite tiresome.

Let's consider a word too long if its length is strictly more than 10 characters. All too long words should be replaced with a special abbreviation.

This abbreviation is made like this: we write down the first and the last letter of a word and between them, we write the number of letters between the first and the last letters. That number is in the decimal system and doesn't contain any leading zeroes.

Thus, "localization" will be spelled as "l10n", and "internationalization» will be spelled as "i18n".

You are suggested to automatize the process of changing the words with abbreviations. At that, all too long words should be replaced by the abbreviation and the words that are not too long should not undergo any changes.
Input
A String S
Output
You are suggested to automatize the process of changing the words with abbreviations. At that, all too long words should be replaced by the abbreviation and the words that are not too long should not undergo any changes.
Constraints
1 < len(s) < 100
Example
Input
localization
Output
l10n

Game modes
Fastest, Shortest, Reverse

Test cases
Test 1 Test
Input
localization
Output
l10n

Validator 1 Validator
Input
internationalization
Output
i18n

Test 2 Test
Input
word
Output
word

Validator 2 Validator
Input
CodinGame
Output
C7e

Test 3 Test
Input
mbb
Output
mbb

Validator 3 Validator
Input
new
Output
new

Test 4 Test
Input
what
Output
what

Validator 4 Validator
Input
whatwhat
Output
w6t

Solution language

Solution

Stub generator input