The present invention provides a novel bicyclic or tricyclic heterocyclic compound represented by the formula (I)wherein ring A is an optionally substituted aromatic group,one of X1 and X2 is a carbon atom, and the other is a nitrogen atom,X3 is a nitrogen atom, or CR2,X4 is a nitrogen atom, or CR3,X5 is a sulfur atom, or -CH=CH-,Z1 is an oxygen atom, -C(R6) (R7)-, -NH-, -C(R6) (R7)-NH-, - NH-C(R6) (R7)-, -C(R6) (R7)-O-, -O-C(R6) (R7) -, or a single bond,one of Z2 and Z3 is CH and the other is a nitrogen atom, or both are nitrogen atoms,and other symbols are as defined in the DESCRIPTION, or a pharmacologically acceptable salt thereof.