A compound of the formula (VIII), or a pharmaceutically acceptable salt thereof; wherein: A and V independently are H, halo, azido, -CN, -CF 3, -CONR 1 R 2, -NR 1 R 2, -SR 2,-OR 2, -R 3, -W, -L-W, -W 0, or -L-N -W 0; each Q is independently halo, azido, -CN, -CF 3, -CONR 1 R 2, -NR 1 R 2, -SR 2, -OR 2, -R 3, -W, -L-W, -W 0, or -L-N -W 0; in each -NR 1 R 2, R 1 and R 2 together with N may form an optionally substituted azacyclic ring, optionally containing an additional heteroatom selected from N, O and S as a ring member; R 1 is H or C1-C6 alkyl, optionally substituted with one or more halogens, or =O; R 2 is H, or C1-C10 alkyl, C1-C10 heteroalkyl, C2-C10 alkenyl, or C2-C10 heteroalkenyl, each of which may be optionally substituted with one or more halogens, =O, or an optionally substituted 3-7 membered carbocyclic or heterocyclic ring; R 3 is an optionally substituted C1-C10 alkyl, C2-C10 alkenyl, C5-C10 aryl, or C6-C12 arylalkyl, or a heteroform of one of these, each of which may be optionally substituted with one or more halogens, =O, or an optionally substituted 3-6 membered carbocyclic or heterocyclic ring; each R 4 is independently H, or C1-C6 alkyl; or R 4 may be -W, -L-W or -L-N -W 0, each R is independently H or C1-C6 alkyl; R 7 is H and R 8 is C1-C4 alkyl substituted with an optionally substituted aromatic heterocyclic ring; m is 0, 1, 2, 3 or 4; n is 0, 1, 2, 3, 4 or 5; p is 0, 1, 2 or 3; L is a C1-C10 alkylene, C1-C10 heteroalkylene, C2-C10 alkenylene or C2-C10 heteroalkenylene linker, each of which may be optionally substituted with one or more substituents selected from the group consisting of halogen, oxo (=O), or C1-C6 alkyl; W is an optionally substituted 4-7 membered azacyclic ring, optionally containing an additional heteroatom selected from N, O and S as a ring member; and W 0 is an optionally substituted 3-4 membered carbocyclic ring, or a C1-C6 alkyl group substituted with from 1 to 4 fluorine atoms. A and V independently are H, halo, azido, -CN, -CF 3, -CONR 1 R 2, -NR 1 R 2, -SR 2,-OR 2, -R 3, -W, -L-W, -W 0, or -L-N -W 0; each Q is independently halo, azido, -CN, -CF 3, -CONR 1 R 2, -NR 1 R 2, -SR 2, -OR 2, -R 3, -W, -L-W, -W 0, or -L-N -W 0; in each -NR 1 R 2, R 1 and R 2 together with N may form an optionally substituted azacyclic ring, optionally containing an additional heteroatom selected from N, O and S as a ring member; R 1 is H or C1-C6 alkyl, optionally substituted with one or more halogens, or =O; R 2 is H, or C1-C10 alkyl, C1-C10 heteroalkyl, C2-C10 alkenyl, or C2-C10 heteroalkenyl, each of which may be optionally substituted with one or more halogens, =O, or an optionally substituted 3-7 membered carbocyclic or heterocyclic ring; R 3 is an optionally substituted C1-C10 alkyl, C2-C10 alkenyl, C5-C10 aryl, or C6-C12 arylalkyl, or a heteroform of one of these, each of which may be optionally substituted with one or more halogens, =O, or an optionally substituted 3-6 membered carbocyclic or heterocyclic ring; each R 4 is independently H, or C1-C6 alkyl; or R 4 may be -W, -L-W or -L-N -W 0, each R is independently H or C1-C6 alkyl; R 7 is H and R 8 is C1-C4 alkyl substituted with an optionally substituted aromatic heterocyclic ring; m is 0, 1, 2, 3 or 4; n is 0, 1, 2, 3, 4 or 5; p is 0, 1, 2 or 3; L is a C1-C10 alkylene, C1-C10 heteroalkylene, C2-C10 alkenylene or C2-C10 heteroalkenylene linker, each of which may be optionally substituted with one or more substituents selected from the group consisting of halogen, oxo (=O), or C1-C6 alkyl; W is an optionally substituted 4-7 membered azacyclic ring, optionally containing an additional heteroatom selected from N, O and S as a ring member; and W 0 is an optionally substituted 3-4 membered carbocyclic ring, or a C1-C6 alkyl group substituted with from 1 to 4 fluorine atoms.