Two sorted arrays A,B are given. You need to process requests of the following type:
1 l r — Delete the sub-section A[l,r], add it to the end of B, and then sort B.
2 l r — Delete the sub-section B[l,r], add it to the end of A, and then sort A.
It is necessary to output the resulting arrays A,B.