DNA pairs (adenine-thymine, guanine-cytosine)
In Principles of Nucleic Acid Structure, W. Saenger argues that hydrogen-bonded bases contain at least two hydrogen bonds (forming a "cyclic" pattern). Often, there is a tautomeric form possible that also makes two hydrogen bonds, with two covalent bonds turning into hydrogen bonds, two hydrogen bonds turning into covalent bonds, and double bonds moving around so that each atom still has an octet. In the OPs first example (A:T pair), for example, the ketone would turn into an enol, and the protonation of the amino and imino groups would change.

Saenger goes on to say that 28 pairs are possible.



Many of these are observed (the ones that are labeled are so common that they were given names), in structures of DNA, RNA, and in crystal structures of dinucleotides. 


  I was wondering why adenine pairs with thymine and cytosine pairs with guanine.


They pair because they make strong hydrogen bonds with a geometry of the base pairs that allows base stacking and is compatible with base pairing of the other nucleotides in a DNA strand. As the discussion above shows, many other base pairs are theoretically possible, and some of them are actually observed in nature.


  Thymine has the lowest acidity and adenine has the biggest acidity. So it is logical that the intermolecular bond will be strong.


I'm not sure about the premise, and the conclusion is incorrect, as other base pairs also form. As long as a group has the right protonation state, the pKa does not directly determine hydrogen bond strength.