Ab initio investigation of the structure and nonlinear optical properties of five-membered heterocycles containing sulfur