Ad
def abbrev(str):
    return str[0] + str(len(str[1::-1])) + str[-1]