S = eval(input())

#-------------

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

#-------------

S = list(S)

n = len(S)

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

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

-print((S[0] + str(len(S) - 2) + S[-1])) +S = list(S) +n = len(S) +print((S[0] + str(n - 2) + S[n - 1]))