The were able to stick together edge to edge because of . In order to make a regular pattern which will allow the pairs of bases to stack on top of each other, a large base has to stick to a small one.
Cytosine and guanine stick together with three hydrogen bonds.
Cytosine (left) sticks to guanine (right) with three hydrogen bonds
In the diagram you can see where the molecules touch.
Thymine and adenine stick together with two hydrogen bonds.
Thymine (left) can stick to adenine (right) with two hydrogen bonds
and get your free badge!