The last pair should be repeated when nested beyond the number of pairs. You should see the below line printed twice.

ACCCDDDB