Synthesis of pyrido[2,3-b]indoles and pyrimidoindoles via Pd-catalyzed amidation and cyclization.