You are on page 1of 1

import sys

s=sys.stdin.read()
y=s.split('\n')
y.pop(0)
for x in y:
if len(x)>10:
print(x[0]+str(len(x[1:-1]))+x[-1])
else:
print(x)

You might also like