#include <bits/stdc++.h>
using namespace std;

#define rep(...) overload_rep(__VA_ARGS__, rep_1, rep_0)(__VA_ARGS__)
#define rep_0(i, end) for(int i = 0; i < (end); ++i)
#define rep_1(i, fr, ba) for(int i = (fr); i <= (ba); ++i)
#define overload_rep(arg0, arg1, arg2, name, ...) name
#define all(box) box.begin(), box.end()

template <class T> inline bool chmax(T& lhs, const T& rhs) { if(lhs < rhs) { lhs = rhs; return 1; } return 0; }
template <class T> inline bool chmin(T& lhs, const T& rhs) { if(lhs > rhs) { lhs = rhs; return 1; } return 0; }

template <class Mn, class Ef, class Om, class Oe, class Me>
struct LazySegmentTree {
private:

    int size, height;
    vector<Mn> node;
    vector<Ef> lazy;
    const Mn unit_m;
    const Ef unit_e;
    const Om oper_m;
    const Oe oper_e;
    const Me merge;

    void squeeze(const int& idx) {
        for(int i = height; i >= 0; --i)
            propagate(idx >> i, 1 << i);
    }

    void elevate(const int& idx) {
        for(int i = idx >> 1, sh = 1; i > 0; i >>= 1, sh <<= 1) 
            node[i] = oper_m(reflection(i << 1, sh), reflection(i << 1 | 1, sh));
    }

    void propagate(const int& idx, const int& length) {
        if(lazy[idx] == unit_e) return;
        if(idx < size) {
            lazy[idx << 1] = oper_e(lazy[idx << 1], lazy[idx]);
            lazy[idx << 1 | 1] = oper_e(lazy[idx << 1 | 1], lazy[idx]);
        }
        node[idx] = merge(node[idx], lazy[idx], length);
        lazy[idx] = unit_e;
    }

    Mn reflection(const int& idx, const int& length) {
        return lazy[idx] == unit_e ? node[idx] : merge(node[idx], lazy[idx], length);
    }

public:

    LazySegmentTree(const Mn& m_, const Ef& e_, const Om& om_, const Oe& oe_, const Me me_)
        : unit_m(m_), unit_e(e_), oper_m(om_), oper_e(oe_), merge(me_) { }
    
    void fill() {
        fill(node.begin(), node.end(), unit_m);
        fill(lazy.begin(), lazy.end(), unit_e);
    }

    void init(const int& size_) {
        for(size = 1, height = 0; size < size_; size <<= 1) ++height;
        node.assign(size << 1, unit_m);
        lazy.assign(size << 1, unit_e);
    }

    void build(const vector<Mn>& node_) {
        init(node_.size());
        for(int& i = 0; i < node_.size(); ++i)
            node[i + size] = node_[i];
        for(int& i = size - 1; i > 0; --i)
            node[i] = oper_m(node[i << 1], node[i << 1 | 1]);
    }

    void effect(const int& l, const int& r, const Ef& value) {
        squeeze(l + size);
        squeeze(r + size - 1);
        for(int tl = l + size, tr = r + size, sh = 1; tl < tr; tl >>= 1, tr >>= 1, sh <<= 1) {
            if(tl & 1) lazy[tl] = oper_e(lazy[tl], value), propagate(tl++, sh);
            if(tr & 1) lazy[--tr] = oper_e(lazy[tr], value), propagate(tr, sh);
        }
        elevate(l + size);
        elevate(r + size - 1);
    }

    Mn fold(const int& l, const int& r) {
        squeeze(l + size);
        squeeze(r + size - 1);
        Mn result_l = unit_m, result_r = unit_m;
        for(int tl = l + size, tr = r + size, sh = 1; tl < tr; tl >>= 1, tr >>= 1, sh <<= 1) {
            if(tl & 1) propagate(tl, sh), result_l = oper_m(node[tl++], result_l);
            if(tr & 1) propagate(--tr, sh), result_r = oper_m(node[tr], result_r);
        }
        return oper_m(result_l, result_r);
    }

    void operator () (const int& l, const int& r, const Ef& value) {
        effect(l, r, value);
    }

    Mn operator () (const int& l, const int& r) {
        return fold(l, r);
    }

    Mn operator [] (const int& idx) {
        return fold(idx, idx + 1);
    }

};

int main() {

    int n, q;
    cin >> n >> q;

    const long long u = 0;
    const auto f = [](long long x, long long y) { return x + y; };
    const auto g = [](long long x, long long y) { return x + y; };
    const auto h = [](long long x, long long y, int length) { return x + y * length; };
    LazySegmentTree<long long, long long, decltype(f), decltype(g), decltype(h)> seg(u, u, f, g, h);
    seg.init(n);

    while(q--) {
        int c;
        cin >> c;
        if(c == 0) {
            int s, t; long long x;
            cin >> s >> t >> x;
            seg(s - 1, t, x);
        } else {
            int i;
            cin >> i;
            cout << seg[i - 1] << '\n';
        }
    }

}



Measured memory_bytes: 7012