#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;

int n;
int q;
vector <ll> inp;

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

    cin >> n;

    for (int i = 0; i < n; ++i) {
        int num;
         cin >> num;
         inp.puba(num);
    }

    cin >> q;

    for (int i = 0; i < q; ++i) {
        //cerr << "i: " << i << endl;
        char ch;
        cin >> ch;
        if (ch == '+') {
            int l, r, d;
            cin >> l >> r >> d;
            --l;--r;
            for (int j = l; j <= r; ++j) {
                inp[j] += d;
            }
        } else {
            int l, r;
            cin >> l >> r;
            --l;--r;
            int have = 1;
            int res = 1;
            for (int j = l + 1; j <= r; ++j) {
                if (inp[j] == inp[j - 1] + 1) {
                    ++have;
                } else {
                    //cerr << j << endl;
                    have = 1;
                }
                //cerr << have << endl;
                res = max(res, have);
            }

            cout << res << endl;
        }
    }

    return 0;
}