def decode_repetition(text):
    stack = []
    pieces = []
    count = 0
    for char in text:
        if char.isdigit():
            count = count * 10 + int(char)
        elif char == '[':
            stack.append((pieces, count))
            pieces, count = [], 0
        elif char == ']':
            parent, repeat = stack.pop()
            parent.append(''.join(pieces) * repeat)
            pieces = parent
        else:
            pieces.append(char)
    return ''.join(pieces)
