#include <bits/stdc++.h>
using namespace std;
#define repl(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define rep(i,n) repl(i,0,n)
#define mp(a,b) make_pair((a),(b))
#define pb(a) push_back((a))
#define all(x) (x).begin(),(x).end()
#define uniq(x) sort(all(x)),(x).erase(unique(all(x)),end(x))
#define fi first
#define se second
#define dbg(...) _dbg(#__VA_ARGS__, __VA_ARGS__)
void _dbg(string){cout<<endl;}
template<class H,class... T> void _dbg(string s,H h,T... t){int l=s.find(',');cout<<s.substr(0,l)<<" = "<<h<<", ";_dbg(s.substr(l+1),t...);}
template<class T,class U> ostream& operator<<(ostream& o, const pair<T,U> &p){o<<"("<<p.fi<<","<<p.se<<")";return o;}
template<class T> ostream& operator<<(ostream& o, const vector<T> &v){o<<"[";for(T t:v){o<<t<<",";}o<<"]";return o;}

#define INF 1120000000

template<typename T>
class SegTree {
private:
  int n;
  vector<T> data;
public:
  SegTree(int m){
    n=1;
    while(n<m) n*=2;
    data = vector<T>(2*n, 0);
  }
  void update(int l, int r, T v){
    for(l+=n, r+=n; l<r; l/=2, r/=2){
      if(l&1) data[l++] += v;
      if(r&1) data[--r] += v;
    }
  }
  T get(int k){
    k += n;
    T ret = data[k];
    while(k>0){
      k = k/2;
      ret += data[k];
    }
    return ret;
  }
};

int main(){
  int n,q;
  cin>>n>>q;
  SegTree<long> st(n);

  rep(_,q){
    int t; cin>>t;
    if(t==0){
      int l,r,v;
      cin>>l>>r>>v;
      st.update(l-1,r,v);
    }
    else {
      int i;
      cin>>i;
      cout << st.get(i-1) << endl;
    }
  }

  return 0;
}