Palladium acetate assisted synthesis of five-membered N-polyheterocycles