; and (4) by adding at the end the following new paragraph: (9) Distribution of additional residency positions (A) Reductions in limit based on unused positions (i) In general If a hospital’s reference resident level (as defined in subparagraph (G)(i)) is less than the otherwise applicable resident limit (as defined in subparagraph (G)(iii)), effective for portions of cost reporting periods occurring on or after July 1, 2018, the otherwise applicable resident limit shall be reduced by 65 percent of the difference between such otherwise applicable resident limit and such reference resident level. (ii) Exception This subparagraph shall not apply to a hospital located in a rural area (as defined in subsection (d)(2)(D)(ii)) with fewer than 250 acute care inpatient beds. (B) Distribution (i) In general The Secretary shall, in accordance with the succeeding provisions of this paragraph, increase the otherwise applicable resident limit for each qualifying hospital that submits an application under this subparagraph by such number as the Secretary may approve for portions of cost reporting periods occurring on or after July 1, 2018. The aggregate number of increases in the otherwise applicable resident limit under this subparagraph shall be equal to the aggregate reduction in such limits attributable to subparagraph (A) (as estimated by the Secretary). (ii) Requirements Subject to clause (iii), a hospital that receives an increase in the otherwise applicable resident limit under this subparagraph shall ensure, during the 3-year period beginning on the date of such increase, that the positions resulting from the increase under this paragraph will be filled. The Secretary may determine whether a hospital has met the requirements under this clause during such 3-year period in such manner and at such time as the Secretary determines appropriate, including at the end of such 3-year period. (iii) Redistribution of positions if hospital no longer meets certain requirements In the case where the Secretary determines that a