Make it short
Problem Statement
Programmers deal with many long words during their career such as translation, localization, internationalization, globalization, etc.. therefore they like to shorten these words whenever possible. For example, localization will become l10n.
To create the short term, take the first character and the last character of the word and then put the count of chracters remaining in between.
l
+ (ocalizati = 10) + n
= l10n
i
+ (nternationalizatio = 18) + n
= i18n
Create a program that will shorten any word using the same method if the word length is longer than 10 characters.
Constraints
term
is a string that is between 1 and 100 characters.
Input
Input is in the following format:
term
Output
Print one of two values:
- The word itself if the length of the word is less than or equal to 10
- The short-term if the length of the word is longer than 10
Samples
Sample 1
Input | Output |
---|---|
hello | hello |
Sample 2
Input | Output |
---|---|
documentation | d11n |
Sample 3
Input | Output |
---|---|
pseudocode | pseudocode |
Comments