The third-harmonic resonance for capillary-gravity waves with O(2) spatial symmetry