Balls

아직 제출이 없습니다시간 제한1초메모리 제한256 MB

문제

There are NN balls on the number line, each of diameter 11, numbered from 11 through NN. Ball ii's leftmost point is located at position p_ip\_i. Additionally, there is an immovable wall located at position PP. You have to process QQ queries of one of the following forms:

  • "1 xx": Insert a new ball with its leftmost point at xx. If this spot is already occupied, do nothing.
  • "2": Roll the leftmost ball to the right. When a rolling ball (possibly after moving distance zero) collides with a stationary ball, it stops, and the stationary ball begins rolling in the same direction. Specifically, a rolling ball stops at the position 11 less than the position of the object it collided with. A ball stops when it reaches the wall.

Calculate the final positions of the balls.

입력

The first line contains three integers NN, QQ, and PP: the initial number of balls, the number of queries, and the position of the wall (1N,Q1051 \leq N, Q \leq 10^5, NP109N \leq P \leq 10^9).

The second line contains NN integers p_1,p_2,,p_Np\_1, p\_2, \ldots, p\_N (0p_i<P0 \leq p\_i < P). It is guaranteed the positions are distinct.

The next QQ lines describe the queries and may have one of the following forms:

  • "1 xx" (0x<P0 \leq x < P)
  • "2"

출력

Print out the final positions of the balls in increasing order on a single line, separated by spaces.