(5)
agree in writing that, at the discretion of the Secretary of the military department concerned, he will—
(A)
(i)
accept an appointment, if offered, as a commissioned officer in the Army, Navy, Air Force, or Marine Corps, as the case may be, and that, if he is commissioned as a regular officer and his regular commission is terminated before the sixth anniversary of his date of rank, he will accept an appointment, if offered, in the reserve component of that armed force and not resign before that anniversary or before such other date, not beyond the eighth anniversary of the midshipman’s date of rank, that the Secretary of Defense may prescribe; and
(ii)
serve on active duty for four or more years;
(B)
(i)
accept an appointment, if offered, as a commissioned officer in the Army, Navy, Air Force, or Marine Corps, as the case may be; and
(ii)
serve in a reserve component of that armed force until the eighth anniversary of the receipt of such appointment, unless otherwise extended by subsection (d) of section
2108 of this title, under such terms and conditions as shall be prescribed by the Secretary of the military department concerned; or
(C)
(i)
accept an appointment, if offered, as a commissioned officer in the Army, Navy, Air Force, or Marine Corps, as the case may be; and
(ii)
serve in a reserve component of that armed force until at least the sixth anniversary and, at the discretion of the Secretary of Defense, up to the eighth anniversary of the receipt of such appointment, unless such appointment is otherwise extended by subsection (d) of section
2108 of this title, under such terms and conditions as may be prescribed by the Secretary of the military department concerned.
The performance of service under clause (5)(B) or (5)(C) may include periods of active duty, active duty for training, and other service in an active or inactive status in the reserve component in which appointed, except that performance of service under clause (5)(C) shall include not less than two years of active duty.