( ( ( N and ) O ) ( both ( ( have ( ( four pairs ) ( of ( electrons ( in ( their ( valence shells ) ) ) ) ) ) ) . ) ) )
(ROOT (S (NP (NNP N) (CC and) (NNP O)) (DT both) (VP (VBP have) (NP (NP (CD four) (NNS pairs)) (PP (IN of) (NP (NP (NNS electrons)) (PP (IN in) (NP (PRP$ their) (JJ valence) (NNS shells))))))) (. .)))
N and O both have four pairs of electrons in their valence shells.
(ROOT (S (NP (NNP Carbon)) (VP (VBZ has) (NP (CD four) (JJ valence) (NNS electrons))) (. .)))