#include <bits/stdc++.h>
using namespace std;
long long ara[200005], dif[200005];
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  ;
  long long n;
  while (cin >> n) {
    long long p = 0;
    for (long long i = 1; i <= n; i++) {
      cin >> ara[i];
      if (i > 1) {
        dif[i] = ara[i] - ara[i - 1];
        if (dif[i] >= 0) p += dif[i];
      }
    }
    long long b1 = (ara[1] - p);
    if (b1 % 2) b1 -= 1;
    b1 /= 2;
    long long c1 = ara[1] - b1;
    long long bn = c1;
    long long cn = ara[n] - bn;
    long long q;
    cin >> q;
    cout << max(max(b1, c1), max(bn, cn)) << endl;
    while (q--) {
      long long l, r, x;
      cin >> l >> r >> x;
      if (l > 1) {
        if (dif[l] >= 0) p -= dif[l];
        dif[l] += x;
        if (dif[l] >= 0) p += dif[l];
      } else {
        ara[l] += x;
      }
      if (r < n) {
        if (dif[r + 1] >= 0) p -= dif[r + 1];
        dif[r + 1] -= x;
        if (dif[r + 1] >= 0) p += dif[r + 1];
      } else if (l != r) {
        ara[r] += x;
      }
      b1 = (ara[1] - p);
      if (b1 % 2) b1 -= 1;
      b1 /= 2;
      c1 = ara[1] - b1;
      bn = c1;
      cn = ara[n] - bn;
      cout << max(max(b1, c1), max(bn, cn)) << endl;
    }
    cout << endl;
  }
  return 0;
}
