(0) Obligation:

Q restricted rewrite system:
The TRS R consists of the following rules:

a(f, a(g, a(f, x))) → a(f, a(g, a(g, a(f, x))))
a(g, a(f, a(g, x))) → a(g, a(f, a(f, a(g, x))))

Q is empty.