CF71A.Way Too Long Words

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

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 1010 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 decimal system and doesn't contain any leading zeroes.

Thus, "localization" will be spelt as "l10n", and "internationalization» will be spelt 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.

输入格式

The first line contains an integer nn ( 1<=n<=1001<=n<=100 ). Each of the following nn lines contains one word. All the words consist of lowercase Latin letters and possess the lengths of from 11 to 100100 characters.

输出格式

Print nn lines. The ii -th line should contain the result of replacing of the ii -th word from the input data.

输入输出样例

  • 输入#1

    4
    word
    localization
    internationalization
    pneumonoultramicroscopicsilicovolcanoconiosis
    

    输出#1

    word
    l10n
    i18n
    p43s
    
首页