; (ii) to ensure family unity; or (iii) if such a waiver is otherwise in the public interest. (B) Factors In making a determination under subparagraph (A), the Secretary of Homeland Security shall consider all relevant factors, including— (i) mitigating and aggravating factors of the basis for inadmissibility; (ii) the duration of the noncitizen’s residence in the United States; and (iii) the degree to which the noncitizen’s removal, or the denial of the noncitizen’s application, would result in hardship to the noncitizen or the noncitizen’s parent, spouse, child, or adult son or daughter. (3) Release from post-order detention A grant of stateless protected status to a principal applicant under subsection (b)(1)(A) shall— (A) in the case of such an applicant who is detained pursuant to an order of removal, trigger immediate release from the custody of the Secretary of Homeland Security; (B) be considered to establish that there is no significant likelihood of the individual's removal in the reasonably foreseeable future