#include <iostream>
using namespace std;

template<typename T, int MAX_N>
struct segment_tree_sum {
    T arr1[MAX_N << 1], arr2[MAX_N << 1]; int N;

    segment_tree_sum(int n) {
        N = 1;
        while (N < n) N *= 2;

        for (int i = 0; i < 2*N-1; ++i) {
            arr1[i] = (T)0;
            arr2[i] = (T)0;
        }
    }

    void add(int a, int b, T v) {
        return add(a, b, v, 0, 0, N);
    }

    void add(int a, int b, T v, int k, int l, int r) {
        if (a <= l && r <= b) {
            arr1[k] += v;
        } else if (!(b <= l || r <= a)) {
            arr2[k] += (min(r, b) - max(l, a)) * v;
            const int m = (l+r) / 2;
            add(a, b, v, 2*k+1, l, m);
            add(a, b, v, 2*k+2, m, r);
        }
    }

    T query(int a, int b) {
        return query(a, b, 0, 0, N);
    }

    T query(int a, int b, int k, int l, int r) {
        if (b <= l || r <= a) {
            return (T)0;
        }
        if (a <= l && r <= b) {
            return (r-l) * arr1[k] + arr2[k];
        }
        const int m = (l+r)/2;
        return (min(r, b) - max(l, a)) * arr1[k] + query(a, b, 2*k+1, l, m) + query(a, b, 2*k+2, m, r);
    }
};

int main(void) {
    cin.tie(0); ios::sync_with_stdio(false);
    int N, Q; cin >> N >> Q;
    segment_tree_sum<long long, 201010> segt(N+1);
    for (int j = 0; j < Q; ++j) {
        int c, s, t, x; cin >> c;
        if (c == 0) {
            cin >> s >> t >> x;
            segt.add(s, t+1, x);
        } else {
            cin >> t;
            cout << segt.query(t, t+1) << endl;
        }
    }
    return 0;
}