The present invention relates to the nitrogenous and cycle compound of the be shown as CRTH2 antagonists of logical formula (I), its pharmaceutically acceptable salt and its stereoisomers, and wherein X1, X2, X3, X4, X5, W, X, Y, L1, L2, L3, A, B are defined as in the description; The invention further relates to the preparation methods of these compounds, and pharmaceutical preparation and pharmaceutical composition and these compounds containing these compounds are in preparation treatment and/or prevent and the application in the drug of the active relevant diseases of CRTH2.本發明涉及通式(I)所示作為CRTH2拮抗劑的含氮并環化合物、其藥學上可接受的鹽及其立體異構體,其中X1、X2、X3、X4、X5、W、X、Y、L1、L2、L3、A、B如說明書中所定義;本發明還涉及這些化合物的製備方法,含有這些化合物的藥物製劑和藥物組合物,以及這些化合物在製備治療和/或預防與CRTH2活性相關的疾病的藥物中的應用。