(0) Obligation:

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

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

Q is empty.