#include <algorithm>
#include <cassert>
#include <cfloat>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <iostream>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>
 
#define FOR(i,k,n) for (int (i)=(k); (i)<(n); ++(i))
#define rep(i,n) FOR(i,0,n)
#define all(v) begin(v), end(v)
#define debug(x) cerr<< #x <<": "<<x<<endl
#define debug2(x,y) cerr<< #x <<": "<< x <<", "<< #y <<": "<< y <<endl
 
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<vector<int> > vvi;
typedef vector<ll> vll;
typedef vector<vector<ll> > vvll;
typedef deque<bool> db;
template<class T> using vv=vector<vector< T > >;

// ?????¨?´???¢????????? (Operator)
struct Sum {
  using T = int; // type or class of monoid
  T operator()(const T& left, const T& right) {
    return left + right;
  }
  static constexpr T identity() { return T(0); } // ????????? ??????????????????????????°??????????????????
};

// ?????¨????????? (Action)
struct Add {
  using T = int; // ?????¨???????????´???????????????
  using Monoid = Sum; // ?????¨?´???¢?????????
  T operator()(const Monoid::T& m, const T& a) { return m + a; }
};
 
template<class Modificate_Action>
class SegTree {
private:
  using T = typename Modificate_Action::T; // ?????¨???????????´??????????????? ??¨???:????????????????????????????±????????????????
  using M = typename Modificate_Action::Monoid::T; // ?????¨?´???¢??????????????°?????? ??¨???:????????????????????§??????????????????????????¨????????´???????????????
  Modificate_Action action; // ?????¨?????????????????????: ?????°????????¨???????????¨?????¨???????????´???????´???????????????¨??????????????????
  typename Modificate_Action::Monoid op; // ?????¨?´???¢?????????????????????: ?????¨?´????????????????????????????????????????(????????????????????¨?´???§??????)
  const int n, h;
  vector<T> t;
  vector<M> deferred_action;
  bool has_lazy;

  void act_node(int i, const M& m) {
    if (i < n) deferred_action[i] = op(m, deferred_action[i]); // if not leaves, unite actions
    else {
      i -= n;
      t[i] = action(m, t[i]); // if leaves, act immediately (to tree)
    }
  }
 
  void propagate_from(int i) {
    act_node(i << 1, deferred_action[i]);
    act_node(i << 1 | 1, deferred_action[i]);
    deferred_action[i] = op.identity();
  }

  void propagate_to(int i) {
    i += n;
    for (int s = (i >> h ? h : h-1); s > 0; --s) propagate_from(i >> s);
  }

  int lg(int n_) {
    int h_;
    for (h_ = 0; n_ != 0; n_ >>= 1) ++h_;
    return h_ - 1;
  }
 
public:
  SegTree(int n_, const T& x) : n(n_), h(lg(n)), t(n, x), deferred_action(n, op.identity()), has_lazy() {}
  SegTree(const vector<T>& v) : n(v.size()), h(lg(n)), t(v), deferred_action(n, op.identity()), has_lazy() {}

  void act_interval(int l, int r, const M& m) {
    propagate_to(l);
    propagate_to(r-1);
    l += n, r += n;
    for ( ; l < r; l >>= 1, r >>= 1) {
      if (l & 1) act_node(l++, m);
      if (r & 1) act_node(r-1, m);
    }
    has_lazy = true;
  }

  void propagate_all() {
    for (int i = 1; i < n; ++i) propagate_from(i);
    has_lazy = false;
  }
 
  void set(int i, const T& x) {
    propagate_to(i);
    t[i] = x;
  }
 
  T get(int i) {
    if (!has_lazy) return t[i];
    T ret = t[i];
    i += n;
    while (i >>= 1) ret = action(deferred_action[i], ret);
    return ret;
  }
};

int main() {
  int n, q;
  scanf("%d %d", &n, &q);
  vi a(n, 0);
  SegTree<Add> segt(a);
  rep (query, q) {
    int qt;
    scanf("%d", &qt);
    if (qt == 1) {
      int i;
      scanf("%d", &i);
      i -= 1;
      printf("%d\n", segt.get(i));
      continue;
    }
    int s, t, x;
    scanf("%d %d %d", &s, &t, &x);
    s -= 1;
    segt.act_interval(s, t, int(x));
  }

  return 0;
}

Measured memory_bytes: 3928