using System;
using System.Collections.Generic;
using System.Linq;
using System.Numerics;
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 st = new SegmentTree<int>(n, (x, y) => x + y, 0);
        for (int i = 0; i < q; i++)
        {
            if (FastIO.Int() == 0)
            {
                var p = FastIO.Int() - 1;
                st[p] += FastIO.Int();
            }
            else
            {
                WriteLine(st.Query(FastIO.Int() - 1, FastIO.Int()));
            }
        }
        Out.Flush();
    }
}

struct L
{
    public long a;
    public long b;
}

public class SegmentTree<T>
{
    T[] buffer;
    Func<T, T, T> F;
    T TI;
    int N;
    public int Length => N;

    public SegmentTree(int length, Func<T, T, T> f, T ti)
    {
        N = length;
        buffer = new T[N * 2];
        for (int i = 0; i < buffer.Length; i++) buffer[i] = ti; //Array.Fill
        F = f;
        TI = ti;
    }

    public SegmentTree(T[] init, Func<T, T, T> f, T ti)
    {
        N = init.Length;
        buffer = new T[N * 2];
        Array.Copy(init, 0, buffer, N, init.Length);
        for (int i = N - 1; i > 0; i--)
        {
            buffer[i] = f(buffer[i * 2 + 0], buffer[i * 2 + 1]);
        }
        F = f;
        TI = ti;
    }

    public void Update(int i, T v)
    {
        i += N;
        buffer[i] = v;
        while ((i >>= 1) != 0)
        {
            buffer[i] = F(buffer[i * 2 + 0], buffer[i * 2 + 1]);
        }
    }

    public T Query(int l, int r)
    {
        var lv = TI;
        var rv = TI;
        for (l += N, r += N; l < r; l >>= 1, r >>= 1)
        {
            if ((l & 1) == 1) lv = F(lv, buffer[l++]);
            if ((r & 1) == 1) rv = F(buffer[--r], rv);
        }
        return F(lv, rv);
    }

    public T this[int i]
    {
        set { Update(i, value); }
        get { return buffer[i + N]; }
    }
}

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;
    }
}



Measured memory_bytes: 17804