#include <bits/stdc++.h>

#define REP(i, n) for (int i = 0; i < n; i++)
#define ALL(obj) obj.begin(), obj.end()

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

const int iINF = 1e9;
const long long llINF = 1e18;
const int MOD = 1e9 + 7;

using namespace std;

template <int MOD>
struct Fp {
    long long val;
    constexpr Fp(long long v = 0) noexcept : val(v % MOD) {
        if (val < 0) val += MOD;
    }
    constexpr int getmod() { return MOD; }
    constexpr Fp operator-() const noexcept { return val ? MOD - val : 0; }
    constexpr Fp operator+(const Fp& r) const noexcept { return Fp(*this) += r; }
    constexpr Fp operator-(const Fp& r) const noexcept { return Fp(*this) -= r; }
    constexpr Fp operator*(const Fp& r) const noexcept { return Fp(*this) *= r; }
    constexpr Fp operator/(const Fp& r) const noexcept { return Fp(*this) /= r; }
    constexpr Fp& operator+=(const Fp& r) noexcept {
        val += r.val;
        if (val >= MOD) val -= MOD;
        return *this;
    }
    constexpr Fp& operator-=(const Fp& r) noexcept {
        val -= r.val;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr Fp& operator*=(const Fp& r) noexcept {
        val = val * r.val % MOD;
        return *this;
    }
    constexpr Fp& operator/=(const Fp& r) noexcept {
        long long a = r.val, b = MOD, u = 1, v = 0;
        while (b) {
            long long t = a / b;
            a -= t * b;
            swap(a, b);
            u -= t * v;
            swap(u, v);
        }
        val = val * u % MOD;
        if (val < 0) val += MOD;
        return *this;
    }
    constexpr bool operator==(const Fp& r) const noexcept { return this->val == r.val; }
    constexpr bool operator!=(const Fp& r) const noexcept { return this->val != r.val; }
    friend constexpr ostream& operator<<(ostream& os, const Fp<MOD>& x) noexcept { return os << x.val; }

    friend constexpr Fp<MOD> modpow(const Fp<MOD>& a, long long n) noexcept {
        if (n == 0) return 1;
        auto t = modpow(a, n / 2);
        t = t * t;
        if (n & 1) t = t * a;
        return t;
    }
};

using mint = Fp<MOD>;

template <class Monoid, class Action>
struct LazySegment {
    using FuncMonoid = function<Monoid(Monoid, Monoid)>;
    using FuncAction = function<Action(Action, Monoid)>;
    using FuncLazy = function<Action(Action, Action)>;
    using FuncProportional = function<Action(Monoid, int)>;

    FuncMonoid FM;
    FuncAction FA;
    FuncLazy FL;
    FuncProportional FP;
    Monoid EM;
    Action EL;
    vector<Monoid> dat;
    vector<Action> lazy;
    int SIZE = 1;

    LazySegment(int n, const FuncMonoid fm, const FuncAction fa, const FuncLazy fl, const FuncProportional fp, const Monoid& em, const Action& el)
        : FM(fm), FA(fa), FL(fl), FP(fp), EM(em), EL(el) {
        while (SIZE < n) SIZE <<= 1;
        dat.assign(2 * SIZE - 1, em);
        lazy.assign(2 * SIZE - 1, el);

        for (int i = SIZE - 2; i >= 0; i--) {
            dat[i] = FM(dat[2 * i + 1], dat[2 * i + 2]);
        }
    }

    void set(int i, const Monoid& x) { dat[i + SIZE - 1] = x; }

    void eval(int k, int len) {
        if (lazy[k] == EL) return;
        if (k < SIZE - 1) {
            lazy[k * 2 + 1] = FL(lazy[k * 2 + 1], lazy[k]);
            lazy[k * 2 + 2] = FL(lazy[k * 2 + 2], lazy[k]);
        }

        dat[k] = FA(dat[k], FP(lazy[k], len));
        lazy[k] = EL;
    }

    void update(int a, int b, const Monoid& x, int k = 0, int l = 0, int r = -1) {
        if (r < 0) r = SIZE;
        eval(k, r - l);
        if (a <= l && r <= b) {
            lazy[k] = FA(lazy[k], x);
            eval(k, r - l);
        } else if (a < r && l < b) {
            update(a, b, x, 2 * k + 1, l, (l + r) / 2);
            update(a, b, x, 2 * k + 2, (l + r) / 2, r);
            dat[k] = FM(dat[2 * k + 1], dat[2 * k + 2]);
        }
    }

    Monoid query(int a, int b, int k = 0, int l = 0, int r = -1) {
        if (r < 0) r = SIZE;
        eval(k, r - l);
        if (b <= l || r <= a) return EM;

        if (a <= l && r <= b) return dat[k];

        Monoid xl = query(a, b, 2 * k + 1, l, (l + r) / 2);
        Monoid xr = query(a, b, 2 * k + 2, (r + l) / 2, r);

        return FM(xl, xr);
    }

    void print() {
        for (int i = 0; i < SIZE; ++i) {
            cout << dat[i];
            if (i != SIZE) cout << ",";
        }
        cout << endl;
    }
};

int main() {
    int n, q;
    cin >> n >> q;
    using Monoid = long long;
    using Action = long long;
    auto fm = [](Monoid a, Monoid b) { return a + b; };
    auto fa = [](Monoid a, Action b) { return a + b; };
    auto fl = [](Action a, Action b) { return a + b; };
    auto fp = [](Action a, int len) { return a * len; };
    Monoid em = 0;
    Action el = 0;

    LazySegment<Monoid, Action> seg(n, fm, fa, fl, fp, em, el);
    while (q > 0) {
        q -= 1;
        int com;
        cin >> com;
        if (com == 0) {
            int s, t, x;
            cin >> s >> t >> x;
            seg.update(s - 1, t, x);
        } else {
            int i;
            cin >> i;
            cout << seg.query(i - 1, i) << endl;
        }
    }
}


Measured memory_bytes: 7072