#include <bits/stdc++.h>
using namespace std;
long long n, q;
long long a[200005];
long long b[200005];
signed main() {
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
  }
  for (long long i = 1; i <= n; i++) {
    b[i] = a[i] - a[i - 1];
  }
  long long sum1 = 0;
  for (long long i = 2; i <= n; i++) {
    if (b[i] > 0) {
      sum1 += b[i];
    }
  }
  cout << (long long)ceil((double)(b[1] + sum1) / 2) << endl;
  cin >> q;
  for (long long i = 1; i <= q; i++) {
    long long l, r, x;
    cin >> l >> r >> x;
    b[l] += x;
    if (l > 1) {
      sum1 += max(1ll * 0, b[l]) - max(1ll * 0, b[l] - x);
    }
    b[r + 1] -= x;
    if (r + 1 <= n) {
      sum1 += max(1ll * 0, b[r + 1]) - max(1ll * 0, b[r + 1] + x);
    }
    cout << (long long)ceil((double)(b[1] + sum1) / 2) << endl;
  }
}
