Compound A will be more acidic than compound B due to the aromaticity of its conjugate base. When compound A loses its proton, the new lone pair of electrons can delocalize with the double bonds in the ring, whereas when compound B is deprotonated, its new lone pair of electrons is localized on the nitrogen. Compound B is the stronger base.
Thymine and Cytosine are derivatives of purine. Adenine and Guanine are derivatives of pyrimidine.