Problem: Write a program which manipulates a sequence A = {a1, a2, . . . , an} with the following operations:

* add(s, t, x): add x to as, as+1, ..., at.
* get(i): output the value of ai.



Note that the initial values of ai (i = 1, 2, . . . , n) are 0.

Constraints

* 1 ≤ n ≤ 100000
* 1 ≤ q ≤ 100000
* 1 ≤ s ≤ t ≤ n
* 1 ≤ i ≤ n
* 0 ≤ x ≤ 1000

Input


n q
query1
query2
:
queryq


In the first line, n (the number of elements in A) and q (the number of queries) are given. Then, ith query queryi is given in the following format:


0 s t x


or


1 t


The first digit represents the type of the query. '0' denotes add(s, t, x) and '1' denotes get(i).

Output

For each get operation, print the value.

Examples

Input

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


Output

3
5


Input

4 3
1 2
0 1 4 1
1 2


Output

0
1

Solution (in CPP):

Solution:
#include <stdio.h>
#include <cmath>
#include <algorithm>
#include <cfloat>
#include <stack>
#include <queue>
#include <vector>
typedef long long int ll;
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000001
using namespace std;

int* uniformity,*partial;
int N = 1;

void init(int first_N){
	while(N < first_N)N *= 2;
}

void add_and_updateNodes(int left,int right,int value,int node_id,int node_left,int node_right){

	if(right < node_left || left > node_right)return;
	else if(left <= node_left && right >= node_right){
		uniformity[node_id] += value;
	}else{
		partial[node_id] += (min(right,node_right)-max(left,node_left)+1)*value;
		add_and_updateNodes(left,right,value,2*node_id+1,node_left,(node_left+node_right)/2);
		add_and_updateNodes(left,right,value,2*node_id+2,(node_left+node_right)/2+1,node_right);
	}
}

int getSum(int left,int right,int node_id,int node_left,int node_right){
	if(right < node_left || left > node_right)return 0;
	else if(left <= node_left && right >= node_right){
		return (node_right-node_left+1)*uniformity[node_id]+partial[node_id];

	}else{
		int sum = (min(right,node_right)-max(left,node_left)+1)*uniformity[node_id];

		sum += getSum(left,right,2*node_id+1,node_left,(node_left+node_right)/2);
		sum += getSum(left,right,2*node_id+2,(node_left+node_right)/2+1,node_right);
		return sum;
	}
}

int main(){

	int first_N,Q,command,left,right,value,loc;
	scanf("%d %d",&first_N,&Q);

	init(first_N);

	uniformity = new int[270000];
	partial = new int[270000];

	for(int i = 0; i <= 2*N-2; i++){
		uniformity[i] = 0;
		partial[i] = 0;
	}

	for(int i = 0; i < Q; i++){
		scanf("%d",&command);

		if(command == 0){
			scanf("%d %d %d",&left,&right,&value);
			left--;
			right--;
			add_and_updateNodes(left,right,value,0,0,N-1);
		}else{
			scanf("%d",&loc);
			loc--;
			printf("%d\n",getSum(loc,loc,0,0,N-1));
		}
	}

	return 0;
}