The present invention relates to compounds of the formula I, the N-oxides, tautomers, the prodrugs and the pharmaceutically acceptable salts thereof: In formula I the variables Het, A, X, Y, Z, R1, R2, R3, R4, R5 and Q are as defined in the claims. The compounds of the formula I, the N-oxides, tautomers, the prodrugs and the pharmaceutically acceptable salts thereof are inhibitors of phosphodiesterase type 10A. Thus, the invention also relates to the use of the compounds of the formula I, the N-oxides, tautomers, the prodrugs and the pharmaceutically acceptable salts thereof for the manufacture of a medicament and which thus are suitable for treating or controlling of medical disorders selected from neurological disorders and psychiatric disorders, for ameliorating the symptoms associated with such disorders and for reducing the risk of such disorders.本發明係關於式I化合物、其N-氧化物、互變異構物、前藥及醫藥上可接受之鹽:在式I中,變數Het、A、X、Y、Z、R1、R2、R3、R4、R5及Q係如申請專利範圍中所定義。該等式I化合物、其N-氧化物、互變異構物、前藥及醫藥上可接受之鹽係磷酸二酯酶第10A型之抑制劑。因此,本發明亦關於該等式I化合物、其N-氧化物、互變異構物、前藥及醫藥上可接受之鹽用於製造藥劑,及其因此適於治療或控制選自神經病症及精神病症之醫學病症、改善該等病症相關之症狀及降低該等病症之風險。