is— (i) in the case of a building which meets the requirements of subparagraph (B), its adjusted basis as of the close of the 1st taxable year of the credit period, and (ii) zero in any other case. (B) Requirements A building meets the requirements of this subparagraph if— (i) the building is acquired by purchase (as defined in section 179(d)(2)), (ii) there is a period of at least 10 years between the date of its acquisition by the taxpayer and the date the building was last placed in service, (iii) the building was not previously placed in service by the taxpayer or by any person who was a related person with respect to the taxpayer as of the time previously placed in service, and (iv) except as provided in subsection (f)(5), a credit is allowable under subsection (a) by reason of subsection (e) with respect to the building. (C) Adjusted basis For purposes of subparagraph (A), the adjusted basis of any building shall not include so much of the basis of such building as is determined by reference to the basis of other property held at any time by the person acquiring the building. (D) Special rules (i) Special rules for certain transfers For purposes of determining under subparagraph (B)(ii) when a building was last placed in service, there shall not be taken into account any placement in service— (I) in connection with the acquisition of the building in a transaction in which the basis of the building in the hands of the person acquiring it is determined in whole or in part by reference to the adjusted basis of such building in the hands of the person from whom acquired, (II) by a person whose basis in such building is determined under section 1014(a) (relating to property acquired from a decedent), (III) by any governmental unit or qualified nonprofit organization if the requirements of subparagraph (B)(ii) are met with respect to the placement in service by such unit or organization and all the income from such property is exempt from Federal income taxation, (IV) by any person who acquired such building by