(0) Obligation:

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

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

Q is empty.