import re


def delete_useless(statement: str) -> str:
    """
    無駄な移動/計算を相殺、削除

    >>> delete_useless("+++--<<>>>")
    '+>'
    >>> delete_useless("---++>><<<")
    '-<'
    >>> delete_useless(">++++[-][-]")
    '>[-]'
    >>> delete_useless(">--[-]++[-]")
    '>[-]'
    """
    while True:
        if "<>" in statement:
            # 無駄な移動の相殺・その１
            statement = statement.replace("<>", "")
            continue
        if "><" in statement:
            # 無駄な移動の相殺・その２
            statement = statement.replace("><", "")
            continue
        if "+-" in statement:
            # 無駄な加減算の相殺・その１
            statement = statement.replace("+-", "")
            continue
        if "-+" in statement:
            # 無駄な加減算の相殺・その２
            statement = statement.replace("-+", "")
            continue
        if "+[-]" in statement or "-[-]" in statement:
            # ゼロクリアの前の加減算の削除
            statement = re.sub(r'[-+]+\[-\]', "[-]", statement)
            continue
        if "[-][-]" in statement:
            # 複数回のゼロクリアを１回に
            statement = statement.replace("[-][-]", "[-]")
            continue
        break
    return statement