; or (ii) a loan insured, made, or guaranteed under title V of the Housing Act of 1949; or (B) a mortgage under which a portion of the proceeds of the mortgage are used to prepay or pay off the outstanding principal and interest owed on an existing loan and a portion of such proceeds are made available to or on behalf of the borrower. (4) Public purpose requirement The mortgage shall meet the requirements of any one of the following subparagraphs: (A) First-time homebuyer The mortgagor under the mortgage is a first-time homebuyer (as such term is defined in section 242) of the property subject to the mortgage and the property is used as the principal residence of the mortgagor. (B) Low- or moderate-income mortgagor The mortgagor under the mortgage is a member of a family as follows: (i) In general A family having an income that is less than 115 percent of the median income, as determined by the FHA, for the area in which the property subject to the mortgage is located, except that the FHA may establish income ceilings higher or lower than 115 percent of the median for the area to take into consideration various sizes of families. (ii) High-cost areas A family that— (I) resides in any area for which the median 1-family house price exceeds the maximum dollar amount limitation in effect for that year on the original principal obligation of a mortgage on a 1-family residence that may be purchased by the Federal Home Loan Mortgage Corporation, as determined under section 305(a)(2) of the Federal Home Loan Mortgage Corporation Act ( 12 U.S.C. 1454(a)(2) )