Novel tricyclic pyrimidine compounds and tricyclic pyridine compounds having JAK inhibitory activities are provided. A tricyclic heterocyclic compound represented by the formula (Ia): wherein the rings Aa and Ba, Xа, Ya, R1a R2a, R3a, Lla, L2a, L3a and na are as defined in the description. EMBED ISISServer (Ia)Запропоновані трициклічні піримідинові сполуки й трициклічні піридинові сполуки, що мають JAK-інгібуючу активність. Трициклічна гетероциклічна сполука представлена формулою (Iа): EMBED ISISServer , (Ia) де кільця Аа і Ва, Xа, Ya, R1a, R2a, R3a, L1a, L2a, L3a і nа визначені в описі.