; and (2) (A) proven beyond a reasonable doubt at trial; or (B) admitted by the defendant. (e) Affirmative defenses It shall be an affirmative defense to a violation of this section that— (1) before the alleged violation, the alien sought and received the express consent of the Secretary to reapply for admission into the United States; or (2) with respect to an alien previously denied admission and removed, the alien— (A) was not required to obtain such advance consent under this Act or any other Act; and (B) had complied with all other laws and regulations governing the alien’s admission into the United States. (f) Limitation on collateral attack on underlying removal order In a criminal proceeding under this section, an alien may not challenge the validity of a removal order described in subsection (a), (b), or (c) concerning the alien unless the alien demonstrates that— (1) the alien exhausted any administrative remedies that may have been available to seek relief against the order; (2) the deportation proceedings at which the order was issued improperly deprived the alien of the opportunity for judicial review; and (3) the entry of the order was fundamentally unfair. (g) Reentry of alien removed before the completion of the term of imprisonment Any alien removed pursuant to section 241(a)(4) who enters, attempts to enter, crosses the border to, attempts to cross the border to, or is at any time found in, the United States— (1) shall be incarcerated for the remainder of the sentence of imprisonment that was pending at the time of deportation without any reduction for parole or supervised release unless the alien affirmatively demonstrates that the Secretary has expressly consented to the alien’s reentry (if a request for consent to reapply is authorized under this section)