#Lutece1934. 这是一道简单题

这是一道简单题

Migrated from Lutece 1934 这是一道简单题

All parts of this problem, including description, images, samples, data and checker, might be broken. If you find bugs in this problem, please contact the admins.

Description

出题人Acnext又要背锅了,他必须出一道大家都会做的简单题,如果有人做不出来他就得背锅,聪明的你能解决这道简单题让他避免背锅吗:

给出一个长nn的数列,以及nn个操作,操作涉及区间加法,单点查询

Input

第一行输入一个数字n,(1n50000)n ,(1 \le n \le 50000)

第二行输入nn个正整数,第ii个数字为ai,(1ai109)a_i,(1 \le a_i \le 10^9),空格隔开

接下来输入nn行询问,每行输入四个数字opt,l,r,c\mathrm{opt},l,r,c

opt=0\mathrm{opt}=0,表示将[l,r][l,r]的数字都加cc

opt=1opt=1,表示询问ara_r的值(忽略l,cl,c)

Output

对于每次询问,输出一行代表答案

保证所有数据在int范围内

Samples

4
1 2 2 3
0 1 3 1
1 0 1 0
0 1 2 2
1 0 2 0
2
5

Note

分块做法有加分哦