(4) Special rules for qualified farm indebtedness (A) In general Any amount which under subsection (b)(2)(E) of section 108 is to be applied to reduce basis and which is attributable to an amount excluded under subsection (a)(1)(C) of section 108— (i) shall be applied only to reduce the basis of qualified property held by the taxpayer, and (ii) shall be applied to reduce the basis of qualified property in the following order: (I) First the basis of qualified property which is depreciable property. (II) Second the basis of qualified property which is land used or held for use in the trade or business of farming. (III) Then the basis of other qualified property. (B) Qualified property For purposes of this paragraph, the term “qualified property” has the meaning given to such term by section 108(g)(3)(C). (C) Certain rules made applicable Rules similar to the rules of subparagraphs (C), (D), and (E) of paragraph (3) shall apply for purposes of this paragraph and section 108(g).