Before and After

5 2
8
5 2
3 2
4
6
2 2
1 2
11
10
9