l = eval(input())

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

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

a = eval(input())
print((a[0] + str(len(a[1:-1])) + a[-1]))

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