#ABC069

s = eval(input())

print((s[0]+str(len(s)-2)+s[-1]))
a,*b,c = input()

print(a,len(b),c,sep="")

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

a, *b, c = input()
print(a, len(b), c, sep="")

-# ABC069 -s = eval(input()) -print((s[0] + str(len(s) - 2) + s[-1])) +a, *b, c = input() +print(a, len(b), c, sep="")