#include <iostream>
#include <string>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <utility>
#include <stack>
#include <numeric>
#include <algorithm>
#include <tuple>
#include <stdio.h>
#include <bitset>
#include <limits.h>
#include <complex>
#include <deque>
#include <iomanip>
#include <list>
#include <cstring>
using namespace std;
#define pi pair<int,int>
#define pl pair<long long,long long>
#define chmax(a,b) (a<b ? a=b:0)
#define chmin(a,b) (a>b ? a=b:0)
#define en cout << endl //セミコロンつけろ
//#define MM 1000000000
//#define MOD MM+7
typedef long long ll;
const int MM = 1e9;
const int MOD = MM+7;
const long double PI = acos(-1);
const long long INF = 1e15;
int dx[8] = {-1,0,1,0,-1,-1,1,1};
int dy[8] = {0,-1,0,1,-1,1,1,-1};
// 'A' = 65, 'Z' = 90, 'a' = 97, 'z' = 122

template<typename T> //最大公約数
T GCD(T u,T v){
    return v ? GCD(v,u%v) : u;
}
template<typename T> //最小公倍数
T LCM(T x,T y){
    T gc = GCD(x,y);
    return x*y/gc;
}

const int COM_MAX = 500500;
long long fac[COM_MAX],finv[COM_MAX],inv[COM_MAX];
void init(){
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for(int i = 2; i < COM_MAX; i++){
        fac[i] = fac[i-1]*i%MOD;
        inv[i] = MOD - inv[MOD%i]*(MOD/i)%MOD;
        finv[i] = finv[i-1]*inv[i]%MOD;
    }
}
long long COM(int n,int k){
    if(n < k || n < 0 || k < 0) return 0;
    return fac[n]*(finv[k]*finv[n-k]%MOD)%MOD;
}


// a^n mod を計算する
long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

// a^{-1} mod を計算する
long long modinv(long long a, long long mod) {
    return modpow(a, mod - 2, mod);
}

template<typename T>
struct BinaryIndexedTree{
	vector< T > data;
	BinaryIndexedTree(T sz){
		data.assign(sz + 1, 0);
  	}

  	T Sum(T k){
		T sum = 0;
		while (k > 0){
			sum += data[k];
			k -= (k & -k);
		}
		return sum;
	}
	
	void Add(T k, T x){
		while (k <= data.size()){
			data[k] += x;
			k += (k & -k);
		}
	}
};


template<typename T>
struct RAQ {
	vector< T > data1, data2;
    const int maxSize = (1 << 18) - 1;

    RAQ(){
            data1.assign(maxSize, 0);
            data2.assign(maxSize, 0);
    } 

	// [a, b)に x を加算する
    void Add(int a, int b, int x, int pos, int left, int right){
        if (a <= left && right <= b){
            data1[pos] += x;
        } else if (left < b && a < right){
            data2[pos] += (min(b, right) - max(a, left)) * x;
            Add(a, b, x, pos*2+1, left, (right+left) / 2);
            Add(a, b, x, pos*2+2, (left+right) / 2, right);
        }
    }

    long long Sum(int a, int b, int pos, int left, int right){
        if (b <= left || right <= a){
            return 0;
        } else if (a <= left && right <= b){
            return data1[pos] * (right - left) + data2[pos];
        } else {
  		    ll res = (min(b, right) - max(a, left)) * data1[pos];
            res += Sum(a, b, pos*2+1, left, (left+right) / 2);
            res += Sum(a, b, pos*2+2, (left+right) / 2, right);
            return res;
        }
    }
};

int main(){
	int N, Q; cin >> N >> Q;
	vector<ll> a(N), ans(0);
	RAQ<ll> raq;

	for (int i = 0; i < Q; i++){
		int c; cin >> c;
		if (c == 0){
			int s, t, x; cin >> s >> t >> x;
			raq.Add(s, t+1, x, 0, 0, N+1);
		} else if (c == 1){
			int cur; cin >> cur;
			ll res = raq.Sum(cur, cur+1, 0, 0, N+1);
			ans.push_back(res);
		}
	}
	for (int i = 0; i < ans.size(); i++){
		cout << ans[i] << endl;
	}
}


Measured memory_bytes: 8716