s = eval(input())

s_s = s[0]

s_e = s[-1]

s = s[1:-1]



nw = s_s + str(len(s)) + s_e

print(nw)
s = eval(input())

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

print(w)
s = eval(input())
s_s = s[0]
s_e = s[-1]
s = s[1:-1]
nw = s_s + str(len(s)) + s_e
print(nw)

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

-s_s = s[0] -s_e = s[-1] -s = s[1:-1] -nw = s_s + str(len(s)) + s_e -print(nw) +w = s[0] + str(len(s[:-2])) + s[-1] +print(w)