The present invention provides compounds of Formula I:and pharmaceutically acceptable salts thereof wherein the variables R1, R2, R3, R4, R5, a and A are as defined herein; processes for the preparation of; intermediates used in the preparation of; and compositions containing such compounds or salts, and their uses for treating D3-mediated (or D3-associated) disorders including, e.g., substance addiction, substance abuse, schizophrenia (e.g., its cognitive symptoms), cognitive impairment (e.g., cognitive impairment associated with schizophrenia, AD or PD), Parkinson's disease, mania, anxiety, impulse control disorders, sexual disorders and depression.本發明提供式I化合物:及其醫藥學上可接受之鹽,其中變數R1、R2、R3、R4、R5、a及A如本文所定義;製備此類化合物或鹽之方法;用於製備此類化合物或鹽之中間物;及含有此類化合物或鹽之組合物,及其用於治療D3介導(或D3相關)之病症之用途,該等病症包括例如物質成癮、物質濫用、精神分裂症(例如其認知症狀)、認知障礙(例如與精神分裂症、AD或PD相關之認知障礙)、帕金森氏病(Parkinson's disease)、躁症、焦慮症、衝動控制障礙、性功能障礙及抑鬱症。