#include <bits/stdc++.h>
#include <bits/stdc++.h>
using namespace std;

int d12, d13, d23, T;

void comparar () {
    int t1=d12+d23;
    int t2=d13+d23;
    int t3=d12+d13;
    if (t1>=t2) {
        T=min(t3,t2);
    } else {
        T=min(t1,t3);    
    }
}

int main () {
    ios_base::sync_with_stdio(0); cin.tie(0);
    cin>>d12>>d13>>d23;
    comparar();
    cout<<T;
        
   return 0;
}

#include <atcoder/fenwicktree>
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

ll solve() {
    ll N, Q, t, a;
    cin >> N >> Q;
    atcoder::fenwick_tree<ll> ft(N);
    for ( int i = 0; i < N; i++ ) {
        cin >> a;
        ft.add(i, a);
    }
    vector<ll> ans;
    for ( int q = 0; q < Q; q++ ) {
        cin >> t;
        if ( t == 0 ) {
            ll p, x;
            cin >> p >> x;
            ft.add(p,x);
        } else {
            ll l, r;
            cin >> l >> r;
            ans.push_back(ft.sum(l,r));
        }
    }
    for ( auto a : ans ) {
        cout << a << "\n";
    }
    return 0;
}

int main() {
    solve();
    return 0;
}