The present application provides fee compounds of formula (J), or pharmaceutically acceptable salts, isomers, tautomer, or a mixture thereof, wherein X, Y, Z, n, m', A', R1, R2, and R3 are described herein. The compounds are inhibitors to the activities of phosphatidyiinositol 3-kinase (PI3K) and are useful for treating conditions mediated by one or more PI3K isoforms. The present application further provides pharmaceutical compositions that include a compound of formula (I), or pharmaceutically acceptable salts, isomers, tautomer or mixture thereof, and methods of using these compounds and compositions for treating conditions mediated by one or more PI3K isoforms.