s to use for sorting.

For the list sorted by start offset, we use the start offset and annotation id. For the end offset we use the
end offset of the annotation only.
&#34;&#34;&#34;

import sys
from sortedcontainers import SortedKeyList


class _KeyStartAnnid:
    def __call__(self, anninfo):
        return (anninfo[0], anninfo[2])


class _KeyStartEndAnnid:
    def __call__(self, anninfo):
        return (anninfo[0], anninfo[1], anninfo[2])


class _KeyEndAnnid:
    def __call__(self, anninfo):
        r