#Pr154. Dynamic Array——动态数组

Dynamic Array——动态数组

Statement

Given an array of nn elements and mm operations, where each operation is one of the following, find the final array (1-based array);

  1. Operation 1: Insert a number yy after the xxth number;
  2. Operation 2: Remove the xxth element.

Input

The first line contains two integers n,mn,m, where n (1<n105)n~(1<n\leq 10^5) indicates that the array contains nn numbers, and m (1m105)m~(1\leq m\leq 10^5) indicates the number of operations;

The next line contains nn numbers aia_i separated by spaces, where 1<ai1091 < a_i \leq 10^9, representing the numbers stored in the array,

The following mm lines contain 33 or 22 numbers separated by spaces, where the first number represents the operation sequence number:

  • If this number is 11, then it is followed by two numbers xx and yy, indicating that a number yy is inserted after the xxth number;
  • If this number is 22, then it is followed by a number xx, indicating the deletion of the xxth number.

Output

Output the numbers in the array in order.

Samples

4 2
59 87 63 60
1 2 90
2 1
87 90 63 60