In general
In the case of a distribution from a qualified tuition program of a designated beneficiary which has been maintained for the 15-year period ending on the date of such distribution, subparagraph (A) shall not apply to so much the portion of such distribution which—
(I)#
does not exceed the aggregate amount contributed to the program (and earnings attributable thereto) before the 5-year period ending on the date of the distribution, and
(II)#
is paid in a direct trustee-to-trustee transfer to a Roth IRA maintained for the benefit of such designated beneficiary.