Echo everything above. TK > LH > AF > BA > > > > > > > > > > UA
Just plan an extra 10-15 minutes to get back over to your departure gate in C or D, especially if you haven't frequented IAD and aren't particularly familiar with the layout.
If you arrive in D take the moon buggy over to A and walk. If you arrive in C take the train and either get off at A and walk or go around to B and start at LH.
If you depart from D leave some extra time to catch the moon buggy back over to D - depending on time of day it can take longer than you expect.