The present invention aims to provide a novel cyclin-dependent kinase 8 and/or 19 inhibitor useful as an anti-cancer agent. The present invention relates to a cyclin-dependent kinase 8 and/or 19 inhibitor containing a compound represented by the formula (I):[wherein each symbol is as defined in the DESCRIPTION] or a pharmaceutically acceptable salt thereof as an active ingredient, and use thereof as an agent for preventing and/or treating cancer.