(0) Obligation:

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

f(f(X)) → f(g(f(g(f(X)))))
f(g(f(X))) → f(g(X))

Q is empty.