#include <cstdio>
#include <iostream>
#include <iomanip>
#include <string> 
#include <vector> 
using namespace std;
  
int main(){
    /*??£???????????????????????????
            int a[2];
            cin >> a[1] >> a[2];
            cout << "[+] " << a[1] + a[2] << endl;
            cout << "[-] " << a[1] - a[2] << endl;
            cout << "[*] " << a[1] * a[2] << endl;
            cout << "[/] " << a[1] / a[2] << endl;
    */

    int a;
    while(cin >> a){
        if(a == 0){break;}
        int ans[10] = {0,0,0,0,0,0,0,0,0,0};
        string ans2[10] = {"","","","","","","","","",""};
        int p;
        for(int i = 1;a >= i;i++){
            cin >> p;ans[p]++;
        }
        for(int i = 0;9 >= i;i++){
            if(ans[i] == 0){
                ans2[i] = "-";
            }else{
                for(int ii = 1;ans[i] >= ii;ii++){
                    ans2[i] += "*";
                }
            }
            cout << ans2[i] << endl;
        }

    }
}
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>
#include <map>

#define debug_value(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << #x << "=" << x << endl;
#define debug(x) cerr << "line" << __LINE__ << ":<" << __func__ << ">:" << x << endl;

using namespace std;
typedef long long ll;

template <typename T>
struct bit{
    int n;
    vector<T> data;

    bit(int n_){
        n = 1;
        while(n < n_) n *= 2;
        data = vector<T>(n+1);
        for(int i = 0; i <= n; i++) data[i] = 0;
    }
    
    T sum(int i){
        T ret = 0;
        while(i > 0){
            ret += data[i];
            i -= i&-i;
        }
        return ret;
    }

    void add(int i, T x){
        while(i <= n){
            data[i] += x;
            i += i&-i;
        }
    }
};


int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << setprecision(10) << fixed;
    int N, Q; cin >> N >> Q;
    bit<ll> bt(N);
    for(int i = 1; i <= N; i++){
        ll a; cin >> a;
        bt.add(i, a);
    }    
    for(int i = 0; i < Q; i++){
        int t; cin >> t;
        if(t == 0){
            int p; ll x; cin >> p >> x; p++;
            bt.add(p, x);
        }else{
            int l, r; cin >> l >> r; r;
            cout << bt.sum(r)-bt.sum(l) << endl;
        }
    }
}