Convenient synthesis of 1,2-dihydroquinoline-3-carboxylic acid and 2H-1-benzothiopyran-3-carboxylic acid derivatives