a, *b, c = input()

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

s = eval(input())

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

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

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