Completion settings:
Axiom: aabb=baa.
Flip LHS and RHS.
Defines rule #2.
Axiom: bbbb=1.
Defines rule #1.