def encode_word(word):
    """
    Return the run-length encoding of a word
    """

    cur = ''
    count = 0
    res = []

    for c in word:
        if c != cur:
            if cur:
                res.extend([str(count), cur])
            cur = c
            count = 1
        else:
            count += 1

    if cur:
        res.extend([str(count), cur])

    return ''.join(res)