This is good, but note that this only makes sense if C should always have both A and B as a pair.
If you just want A to have C and B to have C, but A and B are otherwise not connected to each other, you must put the foreign key in and in B and let it be null.
Update: after clarification, it seems that you need two separate relationships: A can have many Cs, and B can have many Cs, but C can belong to only one A or one B.
. " ", A_C B_C . A_C A C. B_C.