Wythagoras once considered how to get hydras (or trees) past Buchholz ones. I can come up with a certain ruleset for it.

## Definitions

- # is a remainder of tree and they can be different in one expression as in (#)
_{#}unless we state that they are equal. - A(#) is the function which reduces tree to smaller one.
- n is the number of rule-application which we perform.
- ()
_{#}indicates #-leveled node (that is, one tree can express level of another). - R
_{n}is the iterating function which was described by Chris Bird. - Three dots have obvious meaning and can alternate # sign in the rule 3 and indicate omitted (#)
_{#}'s in the rule 2.

## Rules

### Rule 1.

() is the separated node (it has no root):

A(#()) = #

### Rule 2.

() has level 0, but it has a root:

A((#())_{#}) = (#)_{#}(#)_{#}...(#)_{#}(#)_{#}

With n (#)_{#}'s.

### Rule 3.

#'s are equal in the string below, ... must not contain (#)_{#} which have (#)_{#()} in its subtree.

A((...()_{#()}...)_{#}) = R_{n}

R_{m+1} = (...R_{m}...)

R_{0} = (......)

### Rule 4.

#'s is non-empty, rules 1,2 and 3 don't apply.

A((#)) = (A(#))

### Rule 5.

Rules 1-4 don't apply.

A(()_{#}) = ()_{A(#)}

## Examples

()

(()) => ()

((())) => (()) => ()() => ()

(((()))) = ((())) = (()()()) = (()())(()())(()())(()()) = ...

(()_{()}) = (()) = ()()() = ()() = ()

(()_{()})() = (()_{()}) = ((())) = (()()()) = ...

(()_{()})()() = (()_{()})() = (()_{()}) = (((()))) = ((()()()())) = ...

(()_{()})(()) = (()_{()})()() = (()_{()})() = (()_{()}) = (((((()))))) = ...

(()_{()})(()_{()}) = (()_{()})((())) = (()_{()})(()()()) = ...

(()_{()}()) = (()_{()})(()_{()})

(()_{()}(()_{()})) = (()_{()}((())))

(()_{()}()_{()}) = (()_{()}(()_{()}(()_{()})))

(()_{()}()_{()}()_{()}) = (()_{()}()_{()}(()_{()}()_{()}(()_{()}()_{()})))

((())_{()}) = (()_{()}()_{()})

((()())_{()}) = ((())_{()}(())_{()})

(((()))_{()}) = ((()())_{()})

(((()_{()}))_{()}) = ((((())))_{()})

((()_{()})_{()}) = ((((())_{()}))_{()})

(((()_{()})_{()})_{()}) = ((((((())_{()})_{()}))_{()})_{()})

([{}]) = ([[[]]]) = ([[([[([[]])]])]])

([{}[]]) = ([{}([{}([{}])])])

([{}{}]) = ([{}[{}[{}]]])

([{()}]) = ([{}{}]) = ([{}[{}[{}[{}]]]])

([{()()}]) = ([{()}{()}])

([{[]}]) = ([{([{([{[]}])}])}])