f(A) = A @ 1
f(B) = A @ 2
f(C) = B @ 1

g(A) = A @ 1
g(B) = A @ 2
g(C) = B @ 2 

