#include <bits/stdc++.h>
using namespace std;
const int inf = 0x3f3f3f3f;
const int INF = 0x7fffffff;
const double eps = 1e-5;
const int N = 1e5 + 10;
int n, q;
int a[N];
long long d[N];
int main(void) {
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);
  cin >> n;
  long long res = 0;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    d[i] = a[i] - a[i - 1];
    if (i != 1 && d[i] > 0) res += d[i];
  }
  cout << (long long)ceil(0.5 * (res + a[1])) << '\n';
  cin >> q;
  while (q--) {
    int l, r, x;
    cin >> l >> r >> x;
    ++r;
    long long tl = d[l], tr = d[r];
    d[l] += x, d[r] -= x;
    if (l != 1) res -= max(0ll, tl) - max(0ll, d[l]);
    if (r != n + 1) res -= max(0ll, tr) - max(0ll, d[r]);
    cout << (long long)ceil(0.5 * (res + d[1])) << '\n';
  }
  return 0;
}
