(0) Obligation:

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

f(0, 1, x) → f(x, x, x)
f(x, y, z) → 2
0 → 2
1 → 2
g(x, x, y) → y
g(x, y, y) → x

Q is empty.