(3) Capital gains (A) Treatment of capital gain dividends by shareholders A capital gain dividend shall be treated by the shareholders or holders of beneficial interests as a gain from the sale or exchange of a capital asset held for more than 1 year. (B) Definition of capital gain dividend For purposes of this part, a capital gain dividend is any dividend, or part thereof, which is designated by the real estate investment trust as a capital gain dividend in a written notice mailed to its shareholders or holders of beneficial interests at any time before the expiration of 30 days after the close of its taxable year (or mailed to its shareholders or holders of beneficial interests with its annual report for the taxable year); except that, if there is an increase in the excess described in subparagraph (A)(ii) of this paragraph for such year which results from a determination (as defined in section 860(e)), such designation may be made with respect to such increase at any time before the expiration of 120 days after the date of such determination. If the aggregate amount so designated with respect to a taxable year of the trust (including capital gain dividends paid after the close of the taxable year described in section 858) is greater than the net capital gain of the taxable year, the portion of each distribution which shall be a capital gain dividend shall be only that proportion of the amount so designated which such net capital gain bears to the aggregate amount so designated. For purposes of this subparagraph, the amount of the net capital gain for any taxable year which is not a calendar year shall be determined without regard to any net capital loss attributable to transactions after December 31 of such year, and any such net capital loss shall be treated as arising on the 1st day of the next taxable year. To the extent provided in regulations, the preceding sentence shall apply also for purposes of computing the taxable income of the real estate investment trust. (C) Treatment by shareholders of undistributed capital gains (i) Every shareholder of a real estate investment trust at the close of the trust’s taxable year shall include, in computing his long-term capital gains in his return for his taxable year in which the last day of the trust’s taxable year falls, such amount as the trust shall designate in respect of such shares in a written notice mailed to its shareholders at any time prior to the expiration of 60 days after the close of its taxable year (or mailed to its shareholders or holders of beneficial interests with its annual report for the taxable year), but the amount so includible by any shareholder shall not exceed that part of the amount subjected to tax in paragraph (1) which he would have received if all of such amount had been distributed as capital gain dividends by the trust to the holders of such shares at the close of its taxable year. (ii) For purposes of this title, every such shareholder shall be deemed to have paid, for his taxable year under clause (i), the tax imposed by paragraph (1) on undistributed capital gain on the amounts required by this subparagraph to be included in respect of such shares in computing his long-term capital gains for that year; and such shareholders shall be allowed credit or refund as the case may be, for the tax so deemed to have been paid by him. (iii) The adjusted basis of such shares in the hands of the holder shall be increased with respect to the amounts required by this subparagraph to be included in computing his long-term capital gains, by the difference between the amount of such includible gains and the tax deemed paid by such shareholder in respect of such shares under clause (ii). (iv) In the event of such designation, the tax imposed by paragraph (1) on undistributed capital gain shall be paid by the real estate investment trust within 30 days after the close of its taxable year. (v) The earnings and profits of such real estate investment trust, and the earnings and profits of any such shareholder which is a corporation, shall be appropriately adjusted in accordance with regulations prescribed by the Secretary. (vi) As used in this subparagraph, the terms “shares” and “shareholders” shall include beneficial interests and holders of beneficial interests, respectively. (D) Coordination with net operating loss provisions For purposes of section 172, if a real estate investment trust pays capital gain dividends during any taxable year, the amount of the net capital gain for such taxable year (to the extent such gain does not exceed the amount of such capital gain dividends) shall be excluded in determining— (i) the net operating loss for the taxable year, and (ii) the amount of the net operating loss of any prior taxable year which may be carried through such taxable year under section 172(b)(2) to a succeeding taxable year. (E) Certain distributions In the case of a shareholder of a real estate investment trust to whom section 897 does not apply by reason of the second sentence of section 897(h)(1) or subparagraph (A)(ii) or (C) of section 897(k)(2), the amount which would be included in computing long-term capital gains for such shareholder under subparagraph (A) or (C) (without regard to this subparagraph)— (i) shall not be included in computing such shareholder’s long-term capital gains, and (ii) shall be included in such shareholder’s gross income as a dividend from the real estate investment trust. (F) Undistributed capital gain For purposes of this paragraph, the term “undistributed capital gain” means the excess of the net capital gain over the deduction for dividends paid (as defined in section 561 ) determined with reference to capital gain dividends only.