newton/solutions/python/71A.py

11 lines
196 B
Python
Raw Normal View History

2025-01-11 11:41:29 +00:00
n = int(input())
for _ in range(n):
word = input()
if len(word) > 10:
output = word[0] + str(len(word)-2) + word[len(word)-1]
print(output)
else:
print(word)