In the circuit shown the cells are ideal and of equal emfs, the capacitance of the capacitor is `C` and the resistance of the resistor is `R`. `X` is first joined to `Y`and then to `Z`. After a long time, the total heat produced in the resistor will be
A. equal to the energy finally stored in the capacitor
B. half the energy finally stored in the capacitor
C. twice the energy finally stored in the capacitor
D. Four times the energy finally stored in the capacitor