The Secretary shall first be paid an amount which bears the same ratio to such balance in such fund on the date of termination of the fund as the total amount of the Federal capital contributions to such fund by the Secretary pursuant to
section 292q(b)(2)(A) of this title bears to the total amount in such fund derived from such Federal capital contributions and from funds deposited therein pursuant to
section 292q(b)(2)(B) of this title.