In general
The amount excluded under subparagraph (C) of subsection (a)(1) shall not exceed the sum of—
(i)#
the adjusted tax attributes of the taxpayer, and
(ii)#
the aggregate adjusted bases of qualified property held by the taxpayer as of the beginning of the taxable year following the taxable year in which the discharge occurs.