/*

http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_2_E&lang=jp

*/



#include <iostream>
#include <vector>
using namespace std;

typedef long long i64;

typedef i64 segT;

segT node_operator(segT left,segT right)
{
    return left + right;
}

segT lazy_make(int l,int r,segT x,segT lazy)
{
    return lazy + (r - l) * x;
}

segT node_update(segT node,segT lazy)
{
    return node + lazy;
}

segT lazy_throw(segT from,segT to)
{
    return to + from / 2;
}

segT lazy_init(segT lazy)
{
    return 0;
}

//interval add ,interval sum
template<class T>
struct LazySegment
{
    vector<T> node;
    vector<T> lazy;
    vector<bool> lazyFlag;
    int n;
    T init;

    int left(int i)
    {
        return 2 * i + 1;
    }

    int right(int i )
    {
        return 2 * i + 2;
    }

    LazySegment(const vector<i64>& vec,T init_)
    {
        init = init_;
        int sz = vec.size();

        n = 1;
        while(n < sz) n <<= 1;

        node.resize(2 * n - 1,init);
        lazy.resize(2 * n - 1,0);
        lazyFlag.resize(2 * n - 1,false);

        for(int i = 0;i < sz;i++)
        {
            node[n - 1 + i] = vec[i];
        }

        for(int i = n - 2;i >= 0;i--)
        {
            node[i] = node_operator(node[left(i)],node[right(i)]);
        }
    }

    void eval(int k,int l,int r)
    {
        if(lazyFlag[k])
        {
            node[k] = node_update(node[k] , lazy[k]);

            if(r - l > 1)
            {
                lazy[left(k)] = lazy_throw(lazy[k],lazy[left(k)]);
                lazy[right(k)] = lazy_throw(lazy[k],lazy[right(k)]);
                lazyFlag[left(k)] = true;
                lazyFlag[right(k)] = true;
            }

            lazyFlag[k] = false;

            lazy[k] = lazy_init(lazy[k]);
        }
    }

    void update_inter(int a,int b,T x,int k = 0,int l = 0,int r = -1)
    {
        if(r < 0) r = n;

        eval(k,l,r);

        if(b <= l || r <= a) return ;

        if(a <= l && r <= b)
        {
            lazy[k] = lazy_make(l,r,x,lazy[k]);
            lazyFlag[k] = true;
            eval(k,l,r);
        }

        else
        {
            update_inter(a,b,x,left(k),l,(l + r) / 2);
            update_inter(a,b,x,right(k),(l + r) / 2,r);
            node[k] = node_operator(node[left(k)] , node[right(k)]);
        }
    }

    i64 get_inter(int a,int b,int k = 0,int l = 0,int r = -1)
    {
        if(r < 0) r = n;

        eval(k,l,r);
        if(b <= l || r <= a) return init;

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

        i64 lv = get_inter(a,b,left(k),l , (l + r) / 2);
        i64 rv = get_inter(a,b,right(k),(l + r) / 2 , r);

        return node_operator(lv,rv);
    }
};

int main()
{
    int n;
    int q;
    cin >> n >> q;
    vector<i64> vec(n,0);
    LazySegment<i64> seg(vec,0);

    for(int c = 0;c < q;c++)
    {
        int query;
        cin >> query;
        if(query == 0)
        {
            int s,t,x;
            cin >> s >> t >> x;
            s--;
            t--;
            seg.update_inter(s,t + 1,x);
        }
        else
        {
            int i;
            cin >> i;
            i--;
            cout << seg.get_inter(i,i + 1) << endl;
        }
    }
    return 0;
}


Measured memory_bytes: 7884