from sortedcontainers import SortedList sl = SortedList([1, 2])