The problem to be solved by the present invention is to provide a novel compound having a RET inhibitory action. Another object of the present invention is to provide a medicament useful for the prevention and / or treatment of diseases involving RET, particularly cancer, based on the RET inhibitory action. The present invention provides a compound represented by the formula (I) [wherein A, R 2 and X have the meanings as defined in the specification] or a salt thereof. 本発明が解決すべき課題は、RET阻害作用を有する新規な化合物を提供すること。またRET阻害作用に基づき、該RETが関与する疾患、特に癌の予防及び/又は治療に有用な医薬を提供することである。本発明は、式(I)[式中、A、R2、及びXは明細書中で定義したとおりの意味を有する]で表される化合物又はその塩を提供する。