(9) Real property acquired by a qualified organization (A) In general Except as provided in subparagraph (B), the term “acquisition indebtedness” does not, for purposes of this section, include indebtedness incurred by a qualified organization in acquiring or improving any real property. For purposes of this paragraph, an interest in a mortgage shall in no event be treated as real property. (B) Exceptions The provisions of subparagraph (A) shall not apply in any case in which— (i) the price for the acquisition or improvement is not a fixed amount determined as of the date of the acquisition or the completion of the improvement; (ii) the amount of any indebtedness or any other amount payable with respect to such indebtedness, or the time for making any payment of any such amount, is dependent, in whole or in part, upon any revenue, income, or profits derived from such real property; (iii) the real property is at any time after the acquisition leased by the qualified organization to the person selling such property to such organization or to any person who bears a relationship described in section 267(b) or 707(b) to such person; (iv) the real property is acquired by a qualified trust from, or is at any time after the acquisition leased by such trust to, any person who— (I) bears a relationship which is described in subparagraph (C), (E), or (G) of section 4975(e)(2) to any plan with respect to which such trust was formed, or (II) bears a relationship which is described in subparagraph (F) or (H) of section 4975(e)(2) to any person described in subclause (I); (v) any person described in clause (iii) or (iv) provides the qualified organization with financing in connection with the acquisition or improvement; or (vi) the real property is held by a partnership unless the partnership meets the requirements of clauses (i) through (v) and unless— (I) all of the partners of the partnership are qualified organizations, (II) each allocation to a partner of the partnership which is a qualified organization is a qualified allocation (within the meaning of section 168(h)(6) ), or (III) such partnership meets the requirements of subparagraph (E). For purposes of subclause (I) of clause (vi), an organization shall not be treated as a qualified organization if any income of such organization is unrelated business taxable income. (C) Qualified organization For purposes of this paragraph, the term “qualified organization” means— (i) an organization described in section 170(b)(1)(A)(ii) and its affiliated support organizations described in section 509(a)(3); (ii) any trust which constitutes a qualified trust under section 401; (iii) an organization described in section 501(c)(25); or (iv) a retirement income account described in section 403(b)(9). (D) Other pass-thru entities; tiered entities Rules similar to the rules of subparagraph (B)(vi) shall also apply in the case of any pass-thru entity other than a partnership and in the case of tiered partnerships and other entities. (E) Certain allocations permitted (i) In general A partnership meets the requirements of this subparagraph if— (I) the allocation of items to any partner which is a qualified organization cannot result in such partner having a share of the overall partnership income for any taxable year greater than such partner’s share of the overall partnership loss for the taxable year for which such partner’s loss share will be the smallest, and (II) each allocation with respect to the partnership has substantial economic effect within the meaning of section 704(b)(2). For purposes of this clause, items allocated under section 704(c) shall not be taken into account. (ii) Special rules (I) Chargebacks Except as provided in regulations, a partnership may without violating the requirements of this subparagraph provide for chargebacks with respect to disproportionate losses previously allocated to qualified organizations and disproportionate income previously allocated to other partners. Any chargeback referred to in the preceding sentence shall not be at a ratio in excess of the ratio under which the loss or income (as the case may be) was allocated. (II) Preferred rates of return, etc. To the extent provided in regulations, a partnership may without violating the requirements of this subparagraph provide for reasonable preferred returns or reasonable guaranteed payments. (iii) Regulations The Secretary shall prescribe such regulations as may be necessary to carry out the purposes of this subparagraph, including regulations which may provide for exclusion or segregation of items. (F) Special rules for organizations described in section 501(c)(25) (i) In general In computing under section 512 the unrelated business taxable income of a disqualified holder of an interest in an organization described in section 501(c)(25), there shall be taken into account— (I) as gross income derived from an unrelated trade or business, such holder’s pro rata share of the items of income described in clause (ii)(I) of such organization, and (II) as deductions allowable in computing unrelated business taxable income, such holder’s pro rata share of the items of deduction described in clause (ii)(II) of such organization. Such amounts shall be taken into account for the taxable year of the holder in which (or with which) the taxable year of such organization ends. (ii) Description of amounts For purposes of clause (i)— (I) gross income is described in this clause to the extent such income would (but for this paragraph) be treated under subsection (a) as derived from an unrelated trade or business, and (II) any deduction is described in this clause to the extent it would (but for this paragraph) be allowable under subsection (a)(2) in computing unrelated business taxable income. (iii) Disqualified holder For purposes of this subparagraph, the term “disqualified holder” means any shareholder (or beneficiary) which is not described in clause (i) or (ii) of subparagraph (C). (G) Special rules for purposes of the exceptions Except as otherwise provided by regulations— (i) Small leases disregarded For purposes of clauses (iii) and (iv) of subparagraph (B), a lease to a person described in such clause (iii) or (iv) shall be disregarded if no more than 25 percent of the leasable floor space in a building (or complex of buildings) is covered by the lease and if the lease is on commercially reasonable terms. (ii) Commercially reasonable financing Clause (v) of subparagraph (B) shall not apply if the financing is on commercially reasonable terms. (H) Qualifying sales by financial institutions (i) In general In the case of a qualifying sale by a financial institution, except as provided in regulations, clauses (i) and (ii) of subparagraph (B) shall not apply with respect to financing provided by such institution for such sale. (ii) Qualifying sale For purposes of this clause, there is a qualifying sale by a financial institution if— (I) a qualified organization acquires property described in clause (iii) from a financial institution and any gain recognized by the financial institution with respect to the property is ordinary income, (II) the stated principal amount of the financing provided by the financial institution does not exceed the amount of the outstanding indebtedness (including accrued but unpaid interest) of the financial institution with respect to the property described in clause (iii) immediately before the acquisition referred to in clause (iii) or (v), whichever is applicable, and (III) the present value (determined as of the time of the sale and by using the applicable Federal rate determined under section 1274(d)) of the maximum amount payable pursuant to the financing that is determined by reference to the revenue, income, or profits derived from the property cannot exceed 30 percent of the total purchase price of the property (including the contingent payments). (iii) Property to which subparagraph applies Property is described in this clause if such property is foreclosure property, or is real property which— (I) was acquired by the qualified organization from a financial institution which is in conservatorship or receivership, or from the conservator or receiver of such an institution, and (II) was held by the financial institution at the time it entered into conservatorship or receivership. (iv) Financial institution For purposes of this subparagraph, the term “financial institution” means— (I) any financial institution described in section 581 or 591(a), (II) any other corporation which is a direct or indirect subsidiary of an institution referred to in subclause (I) but only if, by virtue of being affiliated with such institution, such other corporation is subject to supervision and examination by a Federal or State agency which regulates institutions referred to in subclause (I), and (III) any person acting as a conservator or receiver of an entity referred to in subclause (I) or (II) (or any government agency or corporation succeeding to the rights or interest of such person). (v) Foreclosure property For purposes of this subparagraph, the term “foreclosure property” means any real property acquired by the financial institution as the result of having bid on such property at foreclosure, or by operation of an agreement or process of law, after there was a default (or a default was imminent) on indebtedness which such property secured.