s = eval(input())

print((s[0] + str(len(s)-2) + s[-1]))
s = eval(input())

x = len(s) - 2

print((s[0]+str(x)+s[-1]))
s = eval(input())
print((s[0] + str(len(s) - 2) + s[-1]))

s = eval(input())
x = len(s) - 2
print((s[0] + str(x) + s[-1]))

-print((s[0] + str(len(s) - 2) + s[-1])) +x = len(s) - 2 +print((s[0] + str(x) + s[-1]))