How can I perserve the order of elements in a list of lists
<p>suppose I have a list</p>

<pre><code>lst1 = [[(1, 1), (1, 2), (1, 3), (1, 4), (1, 5), (2, 1), (2, 2), (2, 3), (3, 1), (3, 2)]]
</code></pre>

<p>and another list</p>

<pre><code>lst2 = [['a', (1, 1)], ['a', (1, 2)], ['a', (1, 3)], ['b', (2, 1)], ['b', (2, 2)]]
</code></pre>

<p>Now How can I make sure that in lst1 every sequence should be as it is, which means there is no (1,2) before (1,1) or (2,3) before (2,2) </p>

<p>and how can make sure that this order is preserved in lst2 which means ['a', (1,2)] should not come before ['a', (1,1)] or ['b',(2,2)] should not come before ['b', (2,1)]</p>
