s = str(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 = str(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 = str(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:]))