A compound of formula I, or a tautomer, or a pharmaceutically acceptable salt thereof, wherein: Z is NH; Ring A is phenyl, or R 1 is optionally substituted alkyl, optionally substituted 3-8 membered saturated or partially unsaturated carbocyclic ring, or halo; or R 1 is absent when Ring A is bicyclic ring; R 2 is a mono-, bi-, or tri-cyclic fused heterocyclic ring, or each R 3 is independently -R, halogen, -OR, -SR, -CN, -NO 2 , -SO 2 R, -SOR, -C(O)R, -CO 2 R, -C(O)N(R) 2 , -NRC(O)R, -NRC(O)N(R) 2 , -NRSO 2 R, or -N(R) 2 ; each R is independently hydrogen, C 1-6 aliphatic, C 5-10 aryl, a 3-8 membered saturated or partially unsaturated carbocyclic ring, a 3-7 membered heterocylic ring having 1-4 heteroatoms independently selected from nitrogen, oxygen, or sulfur, or a 5-6 membered monocyclic heteroaryl ring having 1-4 heteroatoms independently selected from nitrogen, oxygen, or sulfur; each of which is optionally substituted; or two R groups on the same atom are taken together with the atom to which they are attached to form a C 5-10 aryl, a 3-8 membered saturated or partially unsaturated carbocyclic ring, a 3-7 membered heterocylic ring having 1-4 heteroatoms independently selected from nitrogen, oxygen, or sulfur, a 5-6 membered monocyclic heteroaryl ring having 1-4 heteroatoms independently selected from nitrogen, oxygen, or sulfur; a 10-15 membered fused aryl ring; a 6-15 membered saturated or partially unsaturated fused carbocyclic ring; a 10-15 membered fused heteroaryl ring; or a 6-15 membered saturated or partially unsaturated fused heterocyclic ring; each of which is optionally substituted; and n is 0, 1, or 2. Z is NH; Ring A is phenyl, or R 1 is optionally substituted alkyl, optionally substituted 3-8 membered saturated or partially unsaturated carbocyclic ring, or halo; or R 1 is absent when Ring A is bicyclic ring; R 2 is a mono-, bi-, or tri-cyclic fused heterocyclic ring, or each R 3 is independently -R, halogen, -OR, -SR, -CN, -NO 2 , -SO 2 R, -SOR, -C(O)R, -CO 2 R, -C(O)N(R) 2 , -NRC(O)R, -NRC(O)N(R) 2 , -NRSO 2 R, or -N(R) 2 ; each R is independently hydrogen, C 1-6 aliphatic, C 5-10 aryl, a 3-8 membered saturated or partially unsaturated carbocyclic ring, a 3-7 membered heterocylic ring having 1-4 heteroatoms independently selected from nitrogen, oxygen, or sulfur, or a 5-6 membered monocyclic heteroaryl ring having 1-4 heteroatoms independently selected from nitrogen, oxygen, or sulfur; each of which is optionally substituted; or two R groups on the same atom are taken together with the atom to which they are attached to form a C 5-10 aryl, a 3-8 membered saturated or partially unsaturated carbocyclic ring, a 3-7 membered heterocylic ring having 1-4 heteroatoms independently selected from nitrogen, oxygen, or sulfur, a 5-6 membered monocyclic heteroaryl ring having 1-4 heteroatoms independently selected from nitrogen, oxygen, or sulfur; a 10-15 membered fused aryl ring; a 6-15 membered saturated or partially unsaturated fused carbocyclic ring; a 10-15 membered fused heteroaryl ring; or a 6-15 membered saturated or partially unsaturated fused heterocyclic ring; each of which is optionally substituted; and n is 0, 1, or 2. <EOS>