Compound having the formula (1): ** Formula ** or a pharmaceutically acceptable salt thereof, in which: A is ** Formula ** X is N, CH or CR6; X1, X2, X3 and X4 are independently N or CR11; X5, X6, X7 and X8 are independently N or CR12; Z is not substituted or substituted with 1-2 R7 groups and is aryl, 5-6 membered heterocyclic ring or a 5-6 membered heteroaryl; wherein said heterocyclic and heteroaryl ring independently contain 1-2 heteroatoms selected from N, O and S; R1, R2, R3 and R4 are hydrogen or C1-6 alkyl; R5 and R6 are independently halogen, cyano, C1-6 alkoxy, S (O) 2R10 or a C1-6 alkyl unsubstituted or substituted by halogen; R 7 is hydrogen, halogen, cyano, C 1-6 alkoxy, C 1-6 alkyl, C 2-6 alkenyl or C 2-6 alkynyl, each of which is unsubstituted or substituted by halogen, amino, hydroxyl, alkoxy or cyano; -L-W, NR8R9, -L-C (O) R10, -LC (O) OR10, -L-C (O) NR8R9, OR9; -L-S (O) 2R10 or -L-S (O) 2NR8R9; R8 and R9 are independently hydrogen, -L-W, or C1-6 alkyl, C2-6 alkenyl or C2-6 alkynyl, each of which is unsubstituted or substituted by halogen, amino, hydroxyl, alkoxy or cyano; alternatively, R8 and R9 together with the atoms to which they are attached can form a ring; R10 is C1-6 alkyl or -L-W; R11 and R12 are independently hydrogen, halogen, cyano, C1-6 alkoxy or a C1-6 alkyl unsubstituted or substituted by halogen; and L is a bond or (CR2) 1-4 in which R is H or C1-6 alkyl; W is C3-7 cycloalkyl, aryl, 5-6 membered heterocyclic ring or 5-6 membered heteroaryl; wherein said heterocyclic and heteroaryl ring independently contain 1-3 heteroatoms selected from N, O and S; and n and q are independently 0-3.Compuesto que tiene la fórmula (1):**Fórmula** o una sal farmacéuticamente aceptable del mismo, en la que: A es**Fórmula** X es N, CH o CR6; X1, X2, X3 y X4 son independientemente N o CR11; X5, X6, X7 y X8 son independientemente N o CR12; Z no está sustituido o está sustituido con 1-2 grupos R7 y es arilo, anillo heterocíclico de 5-6 miembros o un heteroa