#include <algorithm>
#include <bitset>
#include <cassert>
#include <cctype>
#include <chrono>
#include <cmath>
#include <complex>
#include <cstring>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <vector>

using namespace std;

using int64 = long long;

#define all(_) begin(_), end(_)
#define rall(_) rbegin(_), rend(_)

template <class M, class F>
class SegmentTree {
 public:
  SegmentTree(const std::vector<M>& data, M ie, F f)
      : ie_(ie), data_(data), f_(f) {
    build();
  }

  void update(int pos, M val) {
    assert(0 <= pos && pos < n_);
    pos += n_;
    node_[pos] = val;
    while (pos > 0) {
      pos >>= 1;
      node_[pos] = f_(node_[2 * pos], node_[2 * pos + 1]);
    }
  }

  // return f_[l, r)
  // if l >= r, return ie_
  M query(int l, int r) {
    assert(0 <= l && l < n_ && 0 <= r && r < n_ + 1);
    M vl = ie_, vr = ie_;
    for (l += n_, r += n_; l < r; l >>= 1, r >>= 1) {
      if (l & 1) vl = f_(vl, node_[l++]);
      if (r & 1) vr = f_(node_[--r], vr);
    }
    return f_(vl, vr);
  }

  M operator[](int pos) const {
    assert(0 <= pos && pos < n_);
    return node_[n_ + pos];
  }

 private:
  int n_;
  M ie_;
  std::vector<M> data_;
  std::vector<M> node_;
  F f_;

  void build() {
    int sz = data_.size();
    n_ = 1;
    while (n_ < sz) n_ <<= 1;
    node_.assign(2 * n_, ie_);
    for (int i = 0; i < sz; ++i) node_[i + n_] = data_[i];
    for (int i = n_ - 1; i > 0; --i)
      node_[i] = f_(node_[2 * i], node_[2 * i + 1]);
  }
};

template <class M, class F>
class DualSegmentTree {
 public:
  DualSegmentTree(const std::vector<M>& data, M ie, F f)
      : ie_(ie), data_(data), f_(f) {
    build();
  }

  // modify data_[l, r) -> f_(data_[l], val), ..., f_(data[r - 1], val)
  void modify(int l, int r, M val) {
    thrust(l + n_);
    thrust(r + n_ - 1);
    for (l += n_, r += n_; l < r; l >>= 1, r >>= 1) {
      if (l & 1) lazy_[l] = f_(lazy_[l], val), ++l;
      if (r & 1) --r, lazy_[r] = f_(lazy_[r], val);
    }
  }

  M operator[](int pos) {
    pos += n_;
    thrust(pos);
    return f_(data_[pos - n_], lazy_[pos]);
  }

 private:
  int n_, h_;
  std::vector<M> data_;
  std::vector<M> lazy_;
  F f_;
  M ie_;

  void build() {
    int sz = data_.size();
    n_ = 1;
    h_ = 0;
    while (n_ < sz) n_ <<= 1, ++h_;
    lazy_.assign(2 * n_, ie_);
  }

  inline void propagate(int k) {
    if (lazy_[k] != ie_) {
      lazy_[2 * k + 0] = f_(lazy_[2 * k + 0], lazy_[k]);
      lazy_[2 * k + 1] = f_(lazy_[2 * k + 1], lazy_[k]);
      lazy_[k] = ie_;
    }
  }

  inline void thrust(int k) {
    for (int i = h_; i > 0; --i) propagate(k >> i);
  }
};

void DSL_2_D() {
  int n, q; cin >> n >> q;
  constexpr int inf = 2147483647;
  auto f = [](int x, int y){ return y; };
  DualSegmentTree<int, decltype(f)> seg(vector<int>(n, inf), inf, f);
  while (q--) {
    int op; cin >> op;
    if (op == 0) {
      int s, t, x; cin >> s >> t >> x;
      seg.modify(s, t + 1, x);
    } else {
      int pos; cin >> pos;
      cout << seg[pos] << '\n';
    }
  }
}

void DSL_2_E() {
  int n, q; cin >> n >> q;
  auto f = [](int x, int y){ return x + y; };
  DualSegmentTree<int, decltype(f)> seg(vector<int>(n, 0), 0, f);
  while (q--) {
    int op; cin >> op;
    if (op == 0) {
      int s, t, x; cin >> s >> t >> x; --s; --t;
      seg.modify(s, t + 1, x);
    } else {
      int pos; cin >> pos; --pos;
      cout << seg[pos] << '\n';
    }
  }
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);

  //DSL_2_D();
  DSL_2_E();

  return 0;
}



Measured memory_bytes: 4732