Question
Abbreviate Long Words
In a world of words, some grow far too long, making them difficult to handle. Your task is to shorten these overly lengthy words with a magical abbreviation. Any word with more than 10 characters is considered too long and must be transformed.
The transformation follows a special rule: you keep the first and last letters of the word, but replace everything in between with the count of characters between them. For example, the word "uncharacteristically" would become "u18y", and "internationalization" turns into "i18n".
Your mission is to create a program that automatically detects and abbreviates these long words, while leaving shorter words unchanged.
The transformation follows a special rule: you keep the first and last letters of the word, but replace everything in between with the count of characters between them. For example, the word "uncharacteristically" would become "u18y", and "internationalization" turns into "i18n".
Your mission is to create a program that automatically detects and abbreviates these long words, while leaving shorter words unchanged.
Input
The first line of the input contains a single integer n, representing the number of words.
Each of the following n lines contains one word. All words consist of lowercase Latin letters.
Constraints
1 ≤ N ≤ 100
Each of the following n lines contains one word. All words consist of lowercase Latin letters.
Constraints
1 ≤ N ≤ 100
Output
Print n lines. Each line should contain the result of replacing the corresponding word from the input data. Words that are not too long should remain unchanged.
Example
Sample Input
5
word
localization
internationalization
pneumonoultramicroscopicsilicovolcanoconiosis
hippopotomonstrosesquippedaliophobia
Sample Output
word
l10n
i18n
p43s
h34a
5
word
localization
internationalization
pneumonoultramicroscopicsilicovolcanoconiosis
hippopotomonstrosesquippedaliophobia
Sample Output
word
l10n
i18n
p43s
h34a