(0) Obligation:

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

f(f(x)) → f(c(f(x)))
f(f(x)) → f(d(f(x)))
g(c(x)) → x
g(d(x)) → x
g(c(0)) → g(d(1))
g(c(1)) → g(d(0))

Q is empty.