using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
using System.Runtime.CompilerServices;
using static System.Console;
using static System.Math;

class Program
{
    static void Main()
    {
        SetOut(new System.IO.StreamWriter(OpenStandardOutput()) { AutoFlush = false });
        var n = FastIO.Int();
        var q = FastIO.Int();
        var bit = new DualS<int>(n, (x, y) => x + y, 0);
        for (int i = 0; i < q; i++)
        {
            if (FastIO.Int() == 0)
            {
                var s = FastIO.Int() - 1;
                var t = FastIO.Int();
                var x = FastIO.Int();
                bit.Update(s, t, x);
            }
            else
            {
                var j = FastIO.Int() - 1;
                WriteLine(bit.fold(j));
            }
        }
        Out.Flush();
    }
}

public static class FastIO
{
    static System.IO.Stream str = System.Console.OpenStandardInput();
    const int size = 1024;
    static byte[] buffer = new byte[size];
    static int ptr;
    static int len;

    static byte Read()
    {
        if (ptr == len)
        {
            len = str.Read(buffer, 0, size);
            if (len == 0) return 0;
            ptr = 0;
        }
        return buffer[ptr++];
    }

    public static int Int()
    {
        var c = Read();
        while (c < 0x21)
        {
            c = Read();
        }
        var n = false;
        if (c == '-')
        {
            n = true;
            c = Read();
        }
        var ret = 0;
        while (c > 0x20)
        {
            ret = ret * 10 + c - '0';
            c = Read();
        }
        return n ? -ret : ret;
    }

    public static long Long()
    {
        var c = Read();
        while (c < 0x21)
        {
            c = Read();
        }
        var n = false;
        if (c == '-')
        {
            n = true;
            c = Read();
        }
        var ret = 0L;
        while (c > 0x20)
        {
            ret = ret * 10 + c - '0';
            c = Read();
        }
        return n ? -ret : ret;
    }
}

public class DualC<E>
{
    int N;
    public int Length => N;
    E[] lazy;
    Func<E, E, E> H;
    E EI;

    public DualC(int length, Func<E, E, E> h, E ei)
    {
        N = length;
        lazy = new E[N * 2];
        for (int i = 1; i < lazy.Length; i++)
        {
            lazy[i] = ei;
        }

        EI = ei;
        H = h;
    }

    public void Update(int l, int r, E v)
    {
        l += N;
        r += N;
        while (l < r)
        {
            if ((l & 1) == 1)
            {
                lazy[l] = H(lazy[l], v);
                l++;
            }
            if ((r & 1) == 1)
            {
                --r;
                lazy[r] = H(lazy[r], v);
            }
            l >>= 1;
            r >>= 1;
        }
    }
    //set_valとか書く？インデクサは欲しいか　双対でにぶたんは意味ない？
    public E Query(int k)
    {
        k += N;
        var ret = lazy[k];
        while (k > 1)
        {
            ret = H(ret, lazy[k >> 1]);
            k >>= 1;
        }
        return ret;
    }
}
public class DualS<E>
{
    E[] lazy;
    Func<E, E, E> H;
    E EI;
    int N;
    public int Length => N;
    int height;

    public DualS(int length, Func<E, E, E> h, E ei)
    {
        N = length;
        height = 1;//!log2
        while (1 << height < length) height++;

        lazy = new E[N * 2];//2冪じゃなくてもいい　証明：熨斗さんが言ってた
        for (int i = 0; i < lazy.Length; i++) lazy[i] = ei;//i=1でもいいけど伝播でlazy[0]にアクセスしない保証がいる

        EI = ei;
        H = h;
    }

    void Propagate(int k)
    {
        //if (lazy[k] == EI) return;//定数倍高速化（書けない）
        lazy[k * 2 + 0] = H(lazy[k * 2 + 0], lazy[k]);
        lazy[k * 2 + 1] = H(lazy[k * 2 + 1], lazy[k]);
        lazy[k] = EI;
    }

    void Thrust(int k)
    {
        for (int i = height; i > 0; i--) Propagate(k >> i);
    }

    void thrust(int index)
    {
        if (index == 0) return;
        int lsb = TrailingZeroCount((uint)index);
        for (int h = Log2((uint)index); h != lsb; h--) Propagate(index >> h);
    }

    public void Update(int l, int r, E v)
    {
        l += N;
        r += N;
        //Thrust(l);
        //Thrust(r - 1);
        thrust(l);
        thrust(r);
        while (l < r)
        {
            if ((l & 1) == 1)
            {
                lazy[l] = H(lazy[l], v);
                l++;
            }
            if ((r & 1) == 1)
            {
                --r;
                lazy[r] = H(lazy[r], v);
            }
            l >>= 1;
            r >>= 1;
        }
    }
    //配列初期化は？Update(k, v)とか書く？インデクサは欲しいか　双対でにぶたんは意味ない？
    public E Query(int i)
    {
        i += N;
        thrust(i);
        return lazy[i];
    }

    private static byte[] TrailingZeroCountDeBruijn => new byte[32]
           {
            00, 01, 28, 02, 29, 14, 24, 03,
            30, 22, 20, 15, 25, 17, 04, 08,
            31, 27, 13, 23, 21, 19, 16, 07,
            26, 12, 18, 06, 11, 05, 10, 09
           };

    private static byte[] Log2DeBruijn => new byte[32]
    {
            00, 09, 01, 10, 13, 21, 02, 29,
            11, 14, 16, 18, 22, 25, 03, 30,
            08, 12, 20, 28, 15, 17, 24, 07,
            19, 27, 23, 06, 26, 05, 04, 31
    };

    public static int Log2(uint value)
    {
        return Log2SoftwareFallback(value);
    }

     private static int Log2SoftwareFallback(uint value)
        {
            // No AggressiveInlining due to large method size
            // Has conventional contract 0->0 (Log(0) is undefined)
 
            // Fill trailing zeros with ones, eg 00010010 becomes 00011111
            value |= value >> 01;
            value |= value >> 02;
            value |= value >> 04;
            value |= value >> 08;
            value |= value >> 16;
 
            // uint.MaxValue >> 27 is always in range [0 - 31] so we use Unsafe.AddByteOffset to avoid bounds check
            return Log2DeBruijn[(int)((value * 0x07C4ACDDu) >> 27)];
        }
         public static int TrailingZeroCount(uint value)
        {
            return TrailingZeroCountDeBruijn[(int)(((value & (uint)-(int)value) * 0x077CB531u) >> 27)]; // Multi-cast mitigates redundant conv.u8
        }
 
  public E fold(int index)
    {
        index += N;
        var ret = lazy[index];
        while (index != 1)
        {
            index /= 2;
            ret = H(ret, lazy[index]);
        }
        return ret;
    }
}



Measured memory_bytes: 22100