In the oxygen- and sulfur-containing aromatic rings, one of the electron pairs of the heteroatoms contributes to the aromatic system (similar to the non-basic nitrogen-containing rings). The second lone pair extends in the plane of the ring (similar to the basic nitrogen-containing rings).