#include <vector>
using namespace std;


//Base class for Segment Trees
template <class T>
class segtree_base
{
protected:
	size_t width;
	vector<T> vec;
	T def;
	virtual T query_raw(int l_, int r_, int a_, int b_, int k_) = 0;
public:
	segtree_base(size_t size_, const T& def_ = T()) : def(def_)
	{
		width = 1;
		while (width < size_)width *= 2;
		vec.resize(width * 2 - 1, def);
	}
	//Ask a query in ranges [left,right)
	T query(int left, int right)
	{
		return query_raw(left, right, 0, width, 0);
	}
	//Get the number of child nodes
	size_t treeWidth()
	{
		return width;
	}
	virtual ~segtree_base() {}
};

#include <algorithm>
//Range Minimum Tree
template <class T, class Comp>
class rmq_tree : public segtree_base<T>
{
public:
	rmq_tree(size_t size_) : segtree_base<T>(size_, Comp::defval)
	{}

	//Make [index] <= val;
	void update(int index, T val)
	{
		auto &vec = this->vec;
		index += (this->width - 1);
		vec[index] = val;
		while (index > 0)
		{
			index = (index - 1) / 2;
			vec[index] = std::min(vec[index * 2 + 1], vec[index * 2 + 2], Comp());
		}
	}
private:
	T query_raw(int l_, int r_, int a_, int b_, int k_)override
	{
		const auto &vec = this->vec;
		if (l_ <= a_ && b_ <= r_)
		{
			return vec[k_];
		}
		if (b_ <= l_ || r_ <= a_)
		{
			return this->def;
		}
		int m = (a_ + b_) / 2;
		return std::min(
			query_raw(l_, r_, a_, m, k_ + k_ + 1),
			query_raw(l_, r_, m, b_, k_ + k_ + 2), Comp());
	}
};


#include <algorithm>
//Range Sum + Range Add Tree
template <class T>
class rsaq_tree : public segtree_base<T>
{
protected:
	vector<T>lazy;
public:
	rsaq_tree(size_t size_, const T& def = 0) :segtree_base<T>(size_, def)
	{
		lazy.resize(this->vec.size());
	}

	//Do [] = base
	void init(const vector<int>&base)
	{
		for (int i = 0; i < this->width; i++) this->vec[i + this->width - 1] = base[i];
		for (int i = this->width - 2; i >= 0; i--) this->vec[i] = this->vec[i * 2 + 1] + this->vec[i * 2 + 2];
	}
	//Add val in ranges [left,right)
	void update(int left, int right, int val)
	{
		update_raw(left, right, val, 0, this->width, 0);
	}
private:
	void eval(int k_, int a_, int b_)
	{
		if (lazy[k_] != 0) {
			this->vec[k_] += lazy[k_];
			if (b_ - a_ > 1) {
				lazy[2 * k_ + 1] += lazy[k_] / 2;
				lazy[2 * k_ + 2] += lazy[k_] / 2;
			}
			lazy[k_] = 0;
		}
	}
	void update_raw(int l_, int r_, T x_, int a_, int b_, int k_)
	{
		eval(k_, a_, b_);
		if (r_ <= a_ || b_ <= l_) return;
		if (l_ <= a_ && b_ <= r_) {
			lazy[k_] += (b_ - a_) * x_;
			eval(k_, a_, b_);
		}
		else {
			update_raw(l_, r_, x_, a_, (a_ + b_) / 2, 2 * k_ + 1);
			update_raw(l_, r_, x_, (a_ + b_) / 2, b_, 2 * k_ + 2);
			this->vec[k_] = this->vec[2 * k_ + 1] + this->vec[2 * k_ + 2];
		}
	}
	T query_raw(int l_, int r_, int a_, int b_, int k_)override
	{
		eval(k_, a_, b_);
		if (r_ <= a_ || b_ <= l_) return this->def;
		if (l_ <= a_ && b_ <= r_) return this->vec[k_];
		T vl = query_raw(l_, r_, a_, (a_ + b_) / 2, 2 * k_ + 1);
		T vr = query_raw(l_, r_, (a_ + b_) / 2, b_, 2 * k_ + 2);
		return vl + vr;
	}
};

//Range Minimum + Range Add Tree
template <class T, class Comp>
class rmaq_tree : public segtree_base<T>
{
protected:
	vector<T>lazy;
public:
	rmaq_tree(size_t size_) : segtree_base<T>(size_, Comp::defval)
	{
		lazy.resize(this->vec.size());
	}

	//Do [] <= base
	void init(const vector<int>&base)
	{
		for (int i = 0; i < this->width; i++) this->vec[i + this->width - 1] = base[i];
		for (int i = this->width - 2; i >= 0; i--) this->vec[i] = std::min(this->vec[i * 2 + 1], this->vec[i * 2 + 2], Comp());
	}
	//Add val in ranges [left,right)
	void update(int left, int right, T val)
	{
		update_raw(left, right, val, 0, this->width, 0);
	}
private:
	void eval(int k_, int a_, int b_)
	{
		if (lazy[k_] != 0) {
			this->vec[k_] += lazy[k_];
			if (b_ - a_ > 1) {
				lazy[2 * k_ + 1] += lazy[k_];
				lazy[2 * k_ + 2] += lazy[k_];
			}
			lazy[k_] = 0;
		}
	}
	void update_raw(int l_, int r_, T x_, int a_, int b_, int k_)
	{
		eval(k_, a_, b_);
		if (r_ <= a_ || b_ <= l_) return;
		if (l_ <= a_ && b_ <= r_) {
			lazy[k_] += x_;
			eval(k_, a_, b_);
		}
		else {
			update_raw(l_, r_, x_, a_, (a_ + b_) / 2, 2 * k_ + 1);
			update_raw(l_, r_, x_, (a_ + b_) / 2, b_, 2 * k_ + 2);
			this->vec[k_] = std::min(this->vec[2 * k_ + 1], this->vec[2 * k_ + 2], Comp());
		}
	}
	T query_raw(int l_, int r_, int a_, int b_, int k_)override
	{
		eval(k_, a_, b_);
		if (r_ <= a_ || b_ <= l_) return this->def;
		if (l_ <= a_ && b_ <= r_) return this->vec[k_];
		T vl = query_raw(l_, r_, a_, (a_ + b_) / 2, 2 * k_ + 1);
		T vr = query_raw(l_, r_, (a_ + b_) / 2, b_, 2 * k_ + 2);
		return std::min(vl, vr, Comp());
	}
};



#include <functional>

//Functors for Segment Trees
template <class T>
struct my_less : std::less<T>
{
	static constexpr T defval = std::numeric_limits<T>::max();
};
template <class T>
struct my_greater : std::greater<T>
{
	static constexpr T defval = std::numeric_limits<T>::min();
};

#include <iostream>
#include <climits>

int main()
{
	int n, q;
	cin >> n >> q;
	rmaq_tree<int, my_less<int>>rmq(n);
	rmq.init(vector<int>(rmq.treeWidth(), 0));
	for (int i = 0; i < q; ++i)
	{
		int com;
		cin >> com;
		if (!com)
		{
			int s, t, x;
			cin >> s >> t >> x;
			rmq.update(s - 1, t, x);
		}
		else
		{
			int i;
			cin >> i;
			cout << rmq.query(i - 1, i) << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 5496