

s = eval(input())



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



print(ans)

s = eval(input())

n = len (s) - 2

n = str (n)

print(( s[0] + n + s[-1] ))

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

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

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