(0) Obligation:

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

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

Q is empty.