using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

namespace Competitive
{
    internal class Solution
    {
        public int N, Q;

        public void Run()
        {
            {
                var line = Input.ReadIntArray();
                N = line[0];
                Q = line[1];
            }

            var S = new SegTree(N);

            for(int i = 0; i < Q; i++)
            {
                var line = Input.ReadIntArray();
                int C = line[0];
                if (C == 0)
                {
                    int s = line[1] -1 ;
                    int t = line[2] - 1;
                    int x = line[3];
                    if (C == 0) S.Update(s, t+1, x);
                }
                else
                {
                    int id = line[1] - 1;
                    Console.WriteLine(S.Query(id));
                }
            }

        }
    }

    // libs ----------
    internal class SegTree
    {
        public static bool DEBUG = false;

        public int N;
        public int NCells;
        public int[] Data;
        public int[] KL; // 範囲のbegin
        public int[] KR; // 範囲のend（そのセルは含まない）
        public const int Dummy = -1; 

        public SegTree(int _n)
        {
            Init(_n);
        }

        private int GetN(int _n)
        {
            int n = 1;
            while (n < _n)
            {
                n *= 2;
            }
            return n;
        }

        private void Init(int _n, int initialValue = 0)
        {
            N = GetN(_n);
            NCells = 2 * N - 1;

            Data = new int[NCells];
            KL = new int[NCells];
            KR = new int[NCells];

            // KL, KRの初期化
            for (int k = 0; k < NCells; k++)
            {
                if (IsRoot(k))
                {
                    KL[k] = 0;
                    KR[k] = N;
                }
                else
                {
                    if (IsChildL(k))
                    {
                        KL[k] = KL[Parent(k)];
                        KR[k] = (KL[Parent(k)] + KR[Parent(k)]) / 2;
                    }
                    else
                    {
                        KL[k] = (KL[Parent(k)] + KR[Parent(k)]) / 2;
                        KR[k] = KR[Parent(k)];
                    }
                }
            }

            // 値の初期化
            for (int k = 0; k < NCells; k++) Data[k] = initialValue;

        }

        // i番目のみの値を保持するセル
        public int Pos(int i) { return i + N - 1; }

        // 親セル・子セル
        public int Parent(int k) { return (k - 1) / 2; }
        public int ChildL(int k) { return k * 2 + 1; }
        public int ChildR(int k) { return k * 2 + 2; }

        // 根かどうか
        public bool IsRoot(int k) { return k == 0; }

        // 左側の子かどうか
        public bool IsChildL(int k)
        {
            if (IsRoot(k)) return false;
            return ChildL(Parent(k)) == k;
        }
        
        // Update - top down
        public void Update(int il, int ir, int a)
        {
            update(il, ir, 0, a);

            if (DEBUG)
            {
                Console.WriteLine("--------------");
                int c = 2;
                for (int i = 0; i < NCells; i++)
                {
                    if (i == c - 1)
                    {
                        Console.WriteLine();
                        c *= 2;
                    }
                    Console.Write(Data[i] + " ");
                }
                Console.WriteLine();
                Console.WriteLine("--------------");
            }
        }

        private void update(int il, int ir, int k, int a)
        {
            int kl = KL[k];
            int kr = KR[k];

            if (kr <= il || ir <= kl) return;

            // 完全に重複している場合にその値を加算
            if (il <= kl && kr <= ir)
                Data[k] += a;
            else
            {
                // 子の処理を行う
                update(il, ir, ChildL(k), a);
                update(il, ir, ChildR(k), a);
            }
        }

        // Query - bottom up
        public int Query(int i)
        {
            return query(i, i + 1, 0);
        }

        private int query(int il, int ir, int k)
        {
            int kl = KL[k];
            int kr = KR[k];
            if (kr <= il || ir <= kl) return 0;

            if (il <= kl && kr <= ir)
                return Data[k];
            else
            {
                Data[ChildL(k)] += Data[k];
                Data[ChildR(k)] += Data[k];
                Data[k] = 0;
                return query(il, ir, ChildL(k)) + query(il, ir, ChildR(k));
            }
        }
    }

    // common ----------

    internal static class Input
    {
        public static string ReadString()
        {
            string line = Console.ReadLine();
            return line;
        }

        public static int ReadInt()
        {
            string line = Console.ReadLine();
            return int.Parse(line);
        }

        public static int[] ReadIntArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(int.Parse).ToArray();            
        }

        public static long ReadLong()
        {
            string line = Console.ReadLine();
            return long.Parse(line);
        }

        public static long[] ReadLongArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(long.Parse).ToArray();
        }

        public static double[] ReadDoubleArray()
        {
            string line = Console.ReadLine();
            return line.Split(' ').Select(double.Parse).ToArray();
        }
    }
    
    internal class Program
    {
        public static void Main(string[] args)
        {
            var s = new Solution();
            s.Run();
        }
    }
}


Measured memory_bytes: 14576