The present invention addresses the problem of providing a novel compound that exhibits an RET inhibiting action. In addition, the present invention addresses the problem of providing a medicine that is effective in preventing and/or treating, on the basis of the RET inhibiting action, RET-related diseases, in particular, cancer. The present invention provides a compound represented by formula (I) [in the formula, A, R