#include <bits/stdc++.h>
using namespace std;
ifstream fin ("datorii.in");
ofstream fout ("datorii.out");
int n, m, aib[15007];
void UpDate(int p, int x)
{
while (p <= n)
{
aib[p] += x;
cout << p << " ";
p += (p & (-p));
}
cout << "\n";
}
int Query(int p)
{
int s = 0;
while (p > 0)
{
s += aib[p];
p -= (p & (-p));
}
return s;
}
void Citire()
{
int i, x;
fin >> n >> m;
for (i=1; i<=n; i++)
{
fin >> x;
UpDate(i, x);
}
int op, y;
for (i=1; i<=m; i++)
{
fin >> op >> x >> y;
if (op) fout << Query(y) - Query(x - 1) << "\n";
else UpDate(x, -y);
}
}
int main()
{
Citire();
fin.close();
fout.close();
return 0;
}