# include <stdio.h>

int main(){
    int n, m, perg[111], drink, newt, a = 0;

    scanf("%d", &n);

    for(int i = 0; i < n; ++i){
        scanf("%d", &perg[i]);
        //timee += perg[i];
    }
    scanf("%d", &m);

    for(int i = 0; i<m; ++i){
        int timee = 0;
        scanf("%d %d", &drink, &newt);

        a = perg[drink-1];
        perg[drink-1] = newt;
        for(int j = 0; j< n; ++j){
            timee += perg[j];
        }
        printf("%d\n", timee);
        perg[drink-1] = a;

    }


    return 0;
}