def encode(input_string):
    count = 1
    prev = None
    lst = []
    for character in input_string:
        if character != prev:
            if prev:
                entry = (prev, count)
                lst.append(entry)
            count = 1
            prev = character
        else:
            count += 1
    else:
        try:
            entry = (character, count)
            lst.append(entry)
            return (lst, 0)
        except Exception as e:
            print(.format(e=e)) 
            return (e, 1)

def decode(lst):
    q = []
    for character, count in lst:
        q.append(character * count)
    return ''.join(q)


value = encode()
if value[1] == 0:
    print(.format(value[0]))
    decode(value[0])