#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using Graph=vector<vector<int>>;
using pp=pair<int,pair<int,int>>;
#define MAX 200003
#define MOD 1000000007
#define INF 1000000000000000000

int main(){
  int n,q;
  cin>>n>>q;
  int k=sqrt(n);
  int l=(n+k-1)/k;

  vector<ll> a(n,0);
  vector<ll> b(l,0);

  vector<ll> ans;
  for(int i=0;i<q;i++){
    int c;
    cin>>c;
    if(c==0){
      int s,t;
      ll x;
      cin>>s>>t>>x;
      s--;
      while(s<t&&s%k>0){
        a.at(s)+=x;
        s++;
      }
      while(s<t&&t%k>0){
        t--;
        a.at(t)+=x;
      }
      while(s<t){
        b.at(s/k)+=x;
        s+=k;
      }
    }else{
      int x;
      cin>>x;
      x--;
      ans.push_back(a.at(x)+b.at(x/k));
    }
  }

  for(int i=0;i<ans.size();i++){
    cout<<ans.at(i)<<endl;
  }
}

