You are given an array \(A\) of \(N\) integers \((A_0,A_1,A_2,....,A_{n-1})\). You have to perform \(Q\) queries of two types :
You are give integer \(T\) for each query \(1\) is for update and \(2\) is for query .
- Update : given three integers \(i,x,s\). Add \(x\) to \(A[i]\) and decrease all the other elements of \(A\) by \(s\) .
- Query : given an integer \(y\) find the value of \(A[y]\).
Note : Here we followed 0-based indexing
Input Format
The first line contains one integer \(N\) — the number of elements in the array.
The second line contains \(N\) integers \(A_0,A_1,A_2,...,A_{n-1}\) .
The next line contains one integer \(Q\) — the number of queries to process.
In each query you are given integer \(T\) .
If \(T = 1\) you are given three integers \(i,x\) and \(s\)
If \(T = 2\) you are given one integer \(y\)
Output Format
For each query of type \(2\), print one integer — \(A[y]\) ( 0-based indexing ).
Constraints :
\(1 \leq N,Q \leq 10^5 \\ 1 \leq A[i] \leq 10^5 \\ 1 \leq T \leq 2 \\ 0 \leq i < N \\ 1 \leq x,s\leq 10^5 \\ 0 \leq y < N \\ \)