Kuo-chan is given a sequence A and a constant K as his birthday present from Yang-chan.
Kuo-chan is allowed to perfrom the following operation:
For example, if A = [4, 3, 5], K = 2
push 11 ► A = [4, 3, 5, 11]
pop ► A = [4, 5, 11]
pop ► A = [4, 11]
programming tanoshi ► A = [0, 1]
Yang-chan is curious about what A is after Kuo-chan performs some operations to it.
Help him find it out!
The first line contains three integers N K Q — the length of A, the constant Yang-chan gives Kuo-chan, the number of operations Kuo-chan performs.
The second line contains N integers a1, a2, ..., aN (1 <= ai <= N) — the elements of A.
Each of the next Q lines describes the operations. Each line is one of three types:
Different testcases have different constraints.
You should print one line containing the elements of A after the operations. For 1 <= i <= |A|, the i-th number should be A[ i ].