If property was acquired on an exchange described in this section, section
1035
(a), section
1036(a), or section
1037
(a), then the basis shall be the same as that of the property exchanged, decreased in the amount of any money received by the taxpayer and increased in the amount of gain or decreased in the amount of loss to the taxpayer that was recognized on such exchange. If the property so acquired consisted in part of the type of property permitted by this section, section
1035
(a), section
1036(a), or section
1037
(a), to be received without the recognition of gain or loss, and in part of other property, the basis provided in this subsection shall be allocated between the properties (other than money) received, and for the purpose of the allocation there shall be assigned to such other property an amount equivalent to its fair market value at the date of the exchange. For purposes of this section, section
1035
(a), and section
1036
(a), where as part of the consideration to the taxpayer another party to the exchange assumed (as determined under section
357
(d)) a liability of the taxpayer, such assumption shall be considered as money received by the taxpayer on the exchange.