#include <testlib.h>
#include "bits/stdc++.h"
#define szof(_x) ((int) (_x).size())

using namespace std;
const int MAXN = 1e5;
const int MAXV = 1e9;

int main() {    
    registerValidation();
    
    int n = inf.readInt(1, MAXN);
    inf.readEoln();

    for (int i = 0; i < n; ++i) {
        inf.readInt(-MAXV, MAXV);
        if (i < n - 1) {
            inf.readSpace();
        }
    }

    inf.readEoln();

    int q = inf.readInt(0, MAXN);
    inf.readEoln();

    for (int i = 0; i < q; ++i) {
        //cerr << i << endl;
        char act = inf.readChar();
        ensure(act == '+' || act == '?');
        inf.readSpace();
        if (act == '+') {
            int l = inf.readInt(1, n); inf.readSpace();
            int r = inf.readInt(1, n); inf.readSpace();
            ensure(l <= r);
            inf.readInt(-MAXV, MAXV);
        } else {
            int l = inf.readInt(1, n); inf.readSpace();
            int r = inf.readInt(1, n);
            ensure(l <= r);
        }
        inf.readEoln();
    }

    inf.readEof();
    //cerr << "@" << endl;
    return 0;
}
