2012 summer practice contest 2

D: Relatives