qualifying child of any parent of the individual nor a qualifying child of any specified relative of the individual (in both cases determined without regard to this paragraph), the taxpayer with the highest adjusted gross income for the taxable year which includes such month. (B) Tie-breaker among parents If any individual would (but for this paragraph) be the qualifying child of 2 or more parents of the individual for any month, such child shall be treated only as the qualifying child of— (i) the parent with whom the child resided for the longest period of time during such month, or (ii) if the child resides with both parents for the same amount of time during such month, the parent with the highest adjusted gross income for the taxable year which includes such month. (C) Specified relative For purposes of this paragraph, the term specified relative means an individual who is— (i) an ancestor of a parent of the qualifying child, (ii) a brother or sister of a parent of the qualifying child, or (iii) a brother, sister, stepbrother, or stepsister of the qualifying child. (D) Certain parents or specified relatives not taken into account This paragraph shall be applied without regard to any parent or specified relative of an individual for any month if— (i) such parent or specified relative elects to have such individual not be treated as a qualifying child of such parent or specified relative for such month, (ii) in the case of a parent of such individual, the adjusted gross income of the taxpayer (with respect to whom such individual would be treated as a qualifying child after application of this subparagraph) for the taxable year which includes such month is higher than the highest adjusted gross income of any parent of the individual for the taxable year which includes such month (determined without regard to any parent with respect to whom such individual is not a qualifying child, determined without regard to subparagraphs (A) and (B) and after application of this subparagraph), and (iii) in the case of a