#include "bits/stdc++.h"
#define puba push_back
#define mapa make_pair
#define ff first
#define ss second
#define bend(_x) (_x).begin(), (_x).end()
#define szof(_x) ((int) (_x).size())

using namespace std;
typedef long long ll;
typedef double dbl;
typedef unsigned int ui;
typedef unsigned long long ull;
typedef pair <int, int> pii;
typedef pair <long long, long long> pll;

struct value {
    int best, szl, szr, sz;
    int vl, vr;
    value() {
        best = szl = szr = sz = 0;
        vl = vr = 1;
    }
    value(int num) {
        sz = 1;
        if (num == 1) {
            best = szl = szr = 1;            
            vl = vr = num;
        } else {
            best = szl = szr = 0;
            vl = vr = 1;
        }
    }
    value(int _sz, int _best, int _vl, int _szl, int _vr, int _szr) {
        sz = _sz;
        best = _best;
        vl = _vl;
        szl = _szl;
        if (vl != 1) {
            vl = 1;
            szl = 0;
        }
        vr = _vr;
        szr = _szr;
        if (vr != 1) {
            vr = 1;
            szr = 0;
        }
    }
    value operator+(value v) {        
        value ret;
        ret.sz = sz + v.sz;
        ret.best = max(best, v.best);
        if (vr == v.vl) {
            ret.best = max(ret.best, szr + v.szl);
        }
        ret.vl = vl;
        ret.vr = v.vr;
        ret.szl = szl;
        if (szl == sz && vl == v.vl) {
            ret.szl += v.szl;
        }
        ret.szr = v.szr;
        if (v.szr == v.sz && vr == v.vr) {
            ret.szr += szr;
        }
        return ret;
    }
};

int n, q;
int bdv = 4;

vector <int> inp;
vector <value> rsq;

value segtree_get(int v, int vl, int vr, int l, int r) {
    if (r < vl || vr < l) {
        return value();
    }
    if (l <= vl && vr <= r) {
        return rsq[v];
    }
    int vm = (vl + vr) / 2;
    return segtree_get(v * 2, vl, vm, l, r) + segtree_get(v * 2 + 1, vm + 1, vr, l, r);
}

int segtree_plus(int pos, int num) {
    inp[pos] += num;
    int val = inp[pos];
    pos += bdv;
    rsq[pos] = value(val);
    pos /= 2;
    while (pos) {
        rsq[pos] = rsq[pos * 2] + rsq[pos * 2 + 1];
        pos /= 2;
    }
    return 0;
}

int main() {    
    freopen("atoms.in", "r", stdin);
    freopen("atoms.out", "w", stdout);

    scanf("%d", &n);

    for (int i = 0; i < n; ++i) {
        int num;
        scanf("%d", &num);
        inp.puba(num);
    }

    //cerr << "Writen" << endl;

    while (bdv < szof(inp)) {
        bdv *= 2;
    }

    rsq.resize(bdv * 2);

    for (int i = 0; i < n - 1; ++i) {
        rsq[bdv + i] = value(inp[i + 1] - inp[i]);
        inp[i] = inp[i + 1] - inp[i];
        //cerr << inp[i] - inp[i + 1] << endl;
    }

    for (int i = bdv - 1; i > 0; --i) {
        rsq[i] = rsq[i * 2] + rsq[i * 2 + 1];
    }

    scanf("%d", &q);

    for (int i = 0; i < q; ++i) {
        char act;
        scanf("\n%c", &act);
        if (act == '+') {
            int l, r, d;
            scanf("%d%d%d", &l, &r, &d);
            --l;--r;
            if (l > 0) {
                segtree_plus(l - 1, d);
            }
            if (r < n - 1) {
                segtree_plus(r, -d);
            }
        } else {
            int l, r;
            scanf("%d%d", &l, &r);
            --l;--r;
            value v = segtree_get(1, 0, bdv - 1, l, r - 1);
            printf("%d\n", v.best + 1);            
        }
    }

    /*
    for (int i = 0; i < n - 1; ++i) {
        cerr << inp[i] << endl;
    }*/

    return 0;
}                                                                                    