Mechanisms of the formation of adenine, guanine, and their analogues in UV-irradiated mixed NH3: H2O molecular ices containing purine