import std.stdio, std.string, std.conv;
import std.range, std.algorithm, std.array, std.math;


void main() {
    int n, q;
    scan(n, q);

    auto sd = SqrtDecomp(n);

    foreach (_ ; 0 .. q) {
        auto line = readln.split.to!(int[]);
        if (line[0] == 0) {
            sd.add(line[1] - 1, line[2], line[3]);
        }
        else {
            writeln(sd.get(line[1] - 1));
        }
    }
}

struct SqrtDecomp {
    private {
        enum rt = 512;
        int N, K;
        int[] bucket;
        int[] data;
    }

    this(int n) {
        N = n;
        K = (N + rt - 1) / rt;
        bucket = new int[](K);
        data = new int[](K * rt);
    }

    void add(int l, int r, int x) {
        foreach (k ; 0 .. K) {
            int bl = k * rt, br = (k + 1) * rt;
            if (r <= bl || br <= l) continue;
            if (l <= bl && br <= r) {
                bucket[k] += x;
            }
            else {
                foreach (i ; max(l, bl) .. min(r, br)) {
                    data[i] += x;
                }
            }
        }
    }

    int get(int idx) {
        int k = idx / rt;
        foreach (i ; k * rt .. (k + 1) * rt) {
            data[i] += bucket[k];
        }
        bucket[k] = 0;
        return data[idx];
    }
}



void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}



void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}

