#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define FOR(i, a, b) for (int i = (a); i < int(b); ++i)
#define RFOR(i, a, b) for (int i = (b)-1; i >= int(a); --i)
#define rep(i, n) FOR(i, 0, n)
#define rep1(i, n) FOR(i, 1, int(n) + 1)
#define rrep(i, n) RFOR(i, 0, n)
#define rrep1(i, n) RFOR(i, 1, int(n) + 1)
#define all(c) begin(c), end(c)
const int MOD = 1000000007;

template <typename T>
void __dump__(std::ostream &os, const T &first) {
    os << first;
}
template <typename First, typename... Rest>
void __dump__(std::ostream &os, const First &first, const Rest &... rest) {
    os << first << ", ";
    __dump__(os, rest...);
}
#define dump(...)                                         \
    do {                                                  \
        std::ostringstream os;                            \
        os << __LINE__ << ":\t" << #__VA_ARGS__ << " = "; \
        __dump__(os, __VA_ARGS__);                        \
        std::cerr << os.str() << std::endl;               \
    } while (0)

struct segtree {
    vector<int> dat, lazy;
    int n;
    segtree(int n, int init) {
        this->n = 1;
        while (this->n < n) this->n *= 2;
        dat.resize(this->n*2, init);
        lazy.resize(this->n*2, init);
    }

    void add(int l, int r, int x) {
        add(l, r, x, 1, 0, n);
    }

    void add(int ql, int qr, int x, int s, int sl, int sr) {
        // dump(ql, qr, x, s, sl, sr);
        apply(s, sl, sr);
        if (ql <= sl && sr <= qr) {
            if (lazy[s] == -1) lazy[s] = 0;
            lazy[s] += x;
        } else if (sr <= ql || qr <= sl) {
            return;
        } else {
            int sm = (sl + sr) / 2;
            add(ql, qr, x, s*2    , sl, sm);
            add(ql, qr, x, s*2 + 1, sm, sr);
        }
    }

    int sum(int l, int r) {
        return sum(l, r, 1, 0, n);
    }

    int sum(int ql, int qr, int s, int sl, int sr) {
        apply(s, sl, sr);
        // dump(ql, qr, s, sl, sr);
        if (ql <= sl && sr <= qr) {
            return dat[s];
        } else if (sr <= ql || qr <= sl) {
            return 0;
        } else {
            int sm = (sl + sr) / 2;
            return sum(ql, qr, s*2, sl, sm) + sum(ql, qr, s*2 + 1, sm, sr);
        }
    }

    void apply(int s, int sl, int sr) {
        if (lazy[s] != -1) {
            dat[s] += lazy[s] * (sr - sl);
            if (s*2 + 1 < (int)dat.size()) {
                if (lazy[s*2] == -1) lazy[s*2] = 0;
                lazy[s*2] += lazy[s];
                if (lazy[s*2 + 1] == -1) lazy[s*2 + 1] = 0;
                lazy[s*2+1] += lazy[s];
            }
            lazy[s] = -1;
        }
    }
};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(0);

    int n, q;
    while(cin >> n >> q){
        segtree st(n, 0);
        for(int iq = 0; iq < q; ++iq){
            int t;
            cin >> t;
            // dump(t);
            if(t == 0){
                int s, t, x;
                cin >> s >> t >> x;
                --s;
                st.add(s, t, x);
            } else {
                int i;
                cin >> i;
                --i;
                cout << st.sum(i, i + 1) << '\n';
            }
        }
    }
}

Measured memory_bytes: 4904