Brønsted acid mediated intramolecular cyclization of imides a unified approach to bioactive condensed heterocycles