while True:
    try:
        S = input()
        result = 0
        prev = None
        cur = ""
        print(S)
        for c in S:
            if prev is None:
                prev = c
                result += 1
                print(prev, cur, result)
                continue
            cur += c
            if prev == cur:
                print(prev, cur, result)
                continue
            result += 1
            print(prev, cur, result)
            prev = cur
            cur = ""
        print(result)
    except EOFError:
        break