Generally net short term capital losses can offset net long term capital gains and vice versa. Sec. 1244 stock have certain special rules in terms of treatment of loss. According to IRC Sec. 1244, when the sale of qualified small business stock results in a loss or becomes worthless, losses up to $50,000 ($100,000 for MFJ) can be treated as ordinary losses and the remaining are capital loss.
From the given table, Lark has net short term capital gain of $2,000 ($6,000 - $4,000) and net long term gain of $6,000 ($14,000 - $8,000). Additionally, loss resulting from the worthless Stock X of $5,000 is treated as short term loss (held for < 12 months) will be combined with STCG of $2,000, resulting in net STCL of $(3,000). Given that we have a LTCG of $6,000, the STCL of $(3,000) will be set-off against the LTCG, resulting in net LTCG of $3,000 on Schedule D, Form 1040. The $10,000 loss resulting from the worthlessness of Sec.1244 stock is ordinary loss for Lark and cannot offset any capital gains.