A compound represented by the formula wherein R 1 is a hydrogen atom, alkyl having 1 to 4 carbon atoms or halogen, R 2 is a hydrogen atom, alkyl having 1 to 4 carbon atoms, alkoxy having 1 to 4 carbon atoms, halogen, -OH, -NR 2a R 2b (wherein R 2a is a hydrogen atom, alkyl having 1 to 6 carbon atoms or cycloalkyl having 3 to 8 carbon atoms, R 2b is a hydrogen atom, alkyl having 1 to 6 carbon atoms or cycloalkyl having 3 to 8 carbon atoms), or the formula (a) or (b) (wherein n' is an integer of 1 to 4) R 3 is a hydrogen atom or alkyl having 1 to 4 carbon atoms, R 4 is a hydrogen atom or alkyl having 1 to 4 carbon atoms, R 5 is aryl or heteroaryl (wherein aryl or heteroaryl is optionally substituted by optionally selected 1 to 4 R 6), R 6 is a hydrogen atom, alkyl having 1 to 4 carbon atoms, alkoxy having 1 to 4 carbon atoms, halogen, -CN, -CF 3, -CH 2 F, -CHF 2,-OCF 3, -OH, -NO 2 or -NR 6a R 6b (wherein R 6a is a hydrogen atom, alkyl having 1 to 4 carbon atoms, -CH 2 CH 2 OMe or -CH 2 CH 2 OEt, R 6b is a hydrogen atom, alkyl having 1 to 4 carbon atoms, - CH 2 CH 2 OMe or -CH 2 CH 2 OEt), W is the formula: (wherein R 7 is a hydrogen atom, alkyl having 1 to 4 carbon atoms, alkoxy having 1 to 4 carbon atoms or halogen, R 8 is a hydrogen atom, alkyl having 1 to 4 carbon atoms, alkoxy having 1 to 4 carbon atoms or halogen, X is -N= or -CR 9 =, Y is -N= or -CR 9 =, R 9 is a hydrogen atom, alkyl having 1 to 4 carbon atoms, alkoxy having 1 to 4 carbon atoms, halogen, -OH, -NR 10 R 11, -CH 2 OR 10,-CF 3, -OCF 3, -CN, -C OR 10, -C NR 10 R 11, the formula or, (wherein n is an integer of 1 to 4) X and Y are -CR 9 =, each R 9 may be the same or different, R 10 is a hydrogen atom, alkyl having 1 to 4 carbon atoms,-CH 2 CF 3, -CH 2 CH 2 OH or -CH 2 CH 2 OMe, R 11 is a hydrogen atom, alkyl having 1 to 4 carbon atoms,-CH 2 CF 3, -CH 2 CH 2 OH or -CH 2 CH 2 OMe, or a pharmaceutically acceptable acid addition salt thereof. R 1 is a hydrogen atom, alkyl having 1 to 4 carbon atoms or halogen, R 2 is a hydrogen atom, alkyl having 1 to 4 carbon atoms, alkoxy having 1 to 4 carbon atoms, halogen, -OH, -NR 2a R 2b (wherein R 2a is a hydrogen atom, alkyl having 1 to 6 carbon atoms or cycloalkyl having 3 to 8 carbon atoms, R 2b is a hydrogen atom, alkyl having 1 to 6 carbon atoms or cycloalkyl having 3 to 8 carbon atoms), or the formula (a) or (b) (wherein n' is an integer of 1 to 4) R 3 is a hydrogen atom or alkyl having 1 to 4 carbon atoms, R 4 is a hydrogen atom or alkyl having 1 to 4 carbon atoms, R 5 is aryl or heteroaryl (wherein aryl or heteroaryl is optionally substituted by optionally selected 1 to 4 R 6), R 6 is a hydrogen atom, alkyl having 1 to 4 carbon atoms, alkoxy having 1 to 4 carbon atoms, halogen, -CN, -CF 3, -CH 2 F, -CHF 2,-OCF 3, -OH, -NO 2 or -NR 6a R 6b (wherein R 6a is a hydrogen atom, alkyl having 1 to 4 carbon atoms, -CH 2 CH 2 OMe or -CH 2 CH 2 OEt, R 6b is a hydrogen atom, alkyl having 1 to 4 carbon atoms, - CH 2 CH 2 OMe or -CH 2 CH 2 OEt), W is the formula: (wherein R 7 is a hydrogen atom, alkyl having 1 to 4 carbon atoms, alkoxy having 1 to 4 carbon atoms or halogen, R 8 is a hydrogen atom, alkyl having 1 to 4 carbon atoms, alkoxy having 1 to 4 carbon atoms or halogen, X is -N= or -CR 9 =, Y is -N= or -CR 9 =, R 9 is a hydrogen atom, alkyl having 1 to 4 carbon atoms, alkoxy having 1 to 4 carbon atoms, halogen, -OH, -NR 10 R 11, -CH 2 OR 10,-CF 3, -OCF 3, -CN, -C OR 10, -C NR 10 R 11, the formula or, (wherein n is an integer of 1 to 4) X and Y are -CR 9 =, each R 9 may be the same or different, R 10 is a hydrogen atom, alkyl having 1 to 4 carbon atoms,-CH 2 CF 3, -CH 2 CH 2 OH or -CH 2 CH 2 OMe, R 11 is a hydrogen atom, alkyl having 1 to 4 carbon atoms,-CH 2 CF 3, -CH 2 CH 2 OH or -CH 2 CH 2 OMe,