The compound of formula (IV) is reacted with a compound of formula (V), in the presence of a base such as sodium hydroxide, TEA, potassium carbonate, and the like, in an organic solvent such as DCM, THF, DMF, and the like, to yield the corresponding compound of formula (I).