Provided is a heterocyclic amide compound that may have a PRS inhibitory action and is expected to be useful as a prophylactic or therapeutic agent for PRS associated diseases and the like including cancer. A compound represented by the following formula (I):wherein each symbol is as described in the DESCRIPTION, or a salt thereof.