965. Treatment of deferred foreign income upon transition to participation exemption system of taxation (a) Treatment of deferred foreign income as subpart F income In the case of the last taxable year of a deferred income corporation which begins before January 1, 2018, the subpart F income of such foreign corporation (as otherwise determined for such taxable year under section 952) shall be increased by the greater of— (1) the accumulated post-1986 deferred foreign income of such corporation determined as of November 9, 2017, or (2) the accumulated post-1986 deferred foreign income of such corporation determined as of December 31, 2017. (b) Reduction in amounts included in gross income of united states shareholders of specified foreign corporations with deficits in earnings and profits (1) In general In the case of a taxpayer which is a United States shareholder with respect to at least one deferred foreign income corporation and at least one E&P deficit foreign corporation, the amount which would (but for this subsection) be taken into account under section 951(a)(1) by reason of subsection (a) as such United States shareholder’s pro rata share of the subpart F income of each deferred foreign income corporation shall be reduced by the amount of such United States shareholder’s aggregate foreign E&P deficit which is allocated under paragraph (2) to such deferred foreign income corporation. (2) Allocation of aggregate foreign e&p deficit The aggregate foreign E&P deficit of any United States shareholder shall be allocated among the deferred foreign income corporations of such United States shareholder in an amount which bears the same proportion to such aggregate as— (A) such United States shareholder’s pro rata share of the accumulated post-1986 deferred foreign income of each such deferred foreign income corporation, bears to (B) the aggregate of such United States shareholder’s pro rata share of the accumulated post-1986 deferred foreign income of all deferred foreign income corporations of such United