; and (II) provide for the distribution of positions attributable to such reduction in accordance with the requirements of this paragraph. (C) Capacity considerations in redistribution In determining for which hospitals the increase in the otherwise applicable resident limit is provided under subparagraph (B), the Secretary shall take into account the demonstration likelihood of the hospital filling the positions made available under this paragraph within the first 3 cost reporting periods beginning on or after July 1, 2018, as determined by the Secretary. (D) Priority in redistribution Subject to subparagraphs (C) and (E), the Secretary shall determine which qualifying hospitals receive increases under subparagraph (B) in the otherwise applicable resident limits for such hospitals in a manner that distributes the positions made available to hospitals under this paragraph in accordance with the following: (i) The Secretary shall make such positions available to hospitals with applicable residency training programs. (ii) In the case that the application of clause (i) does not result in the distribution of all positions made available under this paragraph, the Secretary shall make any positions that remain undistributed after the application of such clause available to hospitals that are located in— (I) a State with a resident-to-population ratio in the lowest quartile (as determined by the Secretary); (II) a State, a territory of the United States, or the District of Columbia that is among the top 10 States, territories, or Districts in terms of the ratio of the total population of the State, territory, or District living in an area designated (under such section 332(a)(1)(A)) as a health professional shortage area (as of the date of enactment of this paragraph), to the total population of the State, territory, or District (as determined by the Secretary based on the most recent available population data published by the Bureau of the Census)