A greener and efficient access to substituted four- and six-membered sulfur-bearing heterocycles