1. A compound of formula I: or a pharmaceutically acceptable salt thereof, wherein: R is hydrogen or optionally substituted Califaticheskuyu group, or: r and the substituent on ring A, taken together with the intermediate intervening atoms form an optionally substituted 5-7 membered partially unsaturated or aromatic fused ring having 1-3 heteroatoms independently selected from nitrogen, oxygen or sulfur X is -C (O) - or -S (O) -, Lpredstavlyaet a covalent bond or an optionally substituted divalent group shaven nnuyu of Calkilena, Calkenilena Calkinilena or where one or more methylene units Lneobyazatelno and independently replaced by -Cy-, -O-, -S-, -N (R) -, -C (O) -, -C (O) N (R) -, -N (R) C (O) N (R) -, -N (R) C (O) -, -N (R) C (O) O-, -OC (O) N (R) -, -S (O) -, -S (O) N (R) -, -N (R) S (O) -, -OC (O) - or -C (O) O Cypredstavlyaet a optionally substituted bivalent ring selected from phenylene, 3-7 membered saturated or partially unsaturated carbocyclyl, 4-7-membered saturated or partially unsaturated heterocyclyl having 1-2 heteroatoms independently selected from nitrogen, oxygen or sulfur, or 5-6 membered heteroarylene Having 1-3 heteroatoms independently selected from nitrogen, oxygen, or sulfur each R is hydrogen or an optionally substituted group Califaticheskuyu Apredstavlyaet a covalent bond or a bivalent optionally substituted ring selected from a 3-7 membered saturated or partially unsaturated monocyclic carbocyclyl, 7-10-membered saturated or partially unsaturated bicyclic carbocyclyl, 4-7-membered saturated or partially unsaturated monocyclic heterocyclyl having 1-2 heteroatom