How to delete lines in a file based on an the indices in a list : I have a txt file which is of this format:

1  2  [2, 3, 5]

2  5  [3, 4]

5  6  [4, 5]

4  9  [1, 6]

I need to write a programme such that it would delete the lines having the first column equals to the indices in the list of each line. but, if a line has been processed, then it is safe. 

For example, when it goes to the first line, read the list first, the indices inside is 2, 3 and 5. so it would delete line with first column 2, 3 and 5. so the second and third line are deleted. when it comes to the fourth line, it has indices 1 and 6. However, this time, line 1 has been processed so it would not delete the first line but the line starts with 6.