You are given a sequence A = (A_1, A_2, \dots, A_N)A=(A1,A2,…,AN) of length NN.
Given QQ queries, process all of them in order. The qq-th (1\leq q\leq Q)(1≤q≤Q) query is in one of the following three formats, which represents the following queries:
1\ x _ q1 xq: assign x_qxq to every element of AA.
2\ i _ q\ x _ q2 iq xq: add x_qxq to A _ {i _ q}Aiq.
3\ i _ q3 iq: print the value of A _ {i _ q}Aiq.
Constraints
1 \leq N \leq 2\times10^51≤N≤2×105
1 \leq Q \leq 2\times10^51≤Q≤2×105
0 \leq A _ i \leq 10^9\ (1\leq i\leq N)0≤Ai≤109 (1≤i≤N)
If the qq-th (1\leq q\leq Q)(1≤q≤Q) query is in the second or third format, 1 \leq i _ q \leq N1≤iq≤N.
If the qq-th (1\leq q\leq Q)(1≤q≤Q) query is in the first or second format, 0 \leq x _ q \leq 10^90≤xq≤109.
There exists a query in the third format.
All values in the input are integers.
Input
The input is given from Standard Input in the following format:
NN
A_1A1 A_2A2 \dots… A_NAN
QQ
\operatorname{query}_1query1
\operatorname{query}_2query2
\vdots⋮
\operatorname{query}_QqueryQ
Here, \operatorname{query}_qqueryq denotes the qq-th query, which is in one of following formats: 1 x, 2 i x, and 3 i.
Output
Print XX lines, where XX is the number of qq's (1\leq q\leq Q)(1≤q≤Q) such that \operatorname{query}_qqueryq is in the third format. The jj-th (1\leq j\leq X)(1≤j≤X) line should contain the answer to the jj-th such query.
Sample Input 1 Copy
Copy
5
3 1 4 1 5
6
3 2
2 3 4
3 3
1 1
2 3 4
3 3
Sample Output 1 Copy
Copy
1
8
5
Initially, A=(3,1,4,1,5)A=(3,1,4,1,5). The queries are processed as follows:
A_2=1A2=1, so print 11.
Add 44 to A_3A3, making A=(3,1,8,1,5)A=(3,1,8,1,5).
A_3=8A3=8, so print 88.
Assign 11 to every element of AA, making A=(1,1,1,1,1)A=(1,1,1,1,1).
Add 44 to A_3A3, making A=(1,1,5,1,1)A=(1,1,5,1,1).