https://www.acmicpc.net/problem/10773

python의 pop

pop(x)는 리스트의 x번째 요소를 반환하고 그 요소는 삭제한다.

>>> a = [1, 2, 3]
>>> a.pop(1)
2
>>> a
[1, 3]