The present disclosure provides pyridines and pyrimidines of Formula I and pharmaceutically acceptable salts and solvates thereof: wherein A, G, W1, W2, W3, and R5 are defined as set forth in the specification. The present disclosure also provides uses of the compounds of Formula I and pharmaceutically acceptable salts and solvates thereof. In certain embodiments, Compounds of the present disclosure are useful for treating pain. In another embodiment, Compounds of the present disclosure are useful for treating a disorder responsive to blockade of sodium channels, or alleviating symptoms of the disorder.