#include <bits/stdc++.h>
using namespace std;
long long t, n, m, k, a[100010], q, l, r;
long long d = 0;
long long seg[400010];
void update(long long v, long long tl, long long tr, long long l, long long r,
            long long x) {
  long long tm = (tl + tr) / 2;
  if ((l > tr) || (tl > r)) {
    return;
  }
  if ((tl == l) && (tr == r)) {
    seg[v] += x;
    return;
  }
  update(2 * v, tl, tm, l, min(r, tm), x);
  update(2 * v + 1, tm + 1, tr, max(tm + 1, l), r, x);
}
long long query(long long v, long long tl, long long tr, long long i) {
  long long tm = (tl + tr) / 2;
  long long res = 0;
  if ((tr == tl) && (tm == i)) {
    res = a[i] + seg[v];
    return res;
  }
  if ((i >= tl) && (i <= tm)) {
    seg[2 * v] += seg[v];
    res = query(v * 2, tl, tm, i);
    seg[2 * v] -= seg[v];
  } else {
    seg[2 * v + 1] += seg[v];
    res = query(2 * v + 1, tm + 1, tr, i);
    seg[2 * v + 1] -= seg[v];
  }
  return res;
}
int32_t main() {
  ios_base ::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
  cin >> n;
  for (long long i = 1; i <= n; i++) {
    cin >> a[i];
    if (i > 1) {
      d += max(0ll, a[i] - a[i - 1]);
    }
  }
  cout << (((a[1] + d) + (abs(a[1] + d) % 2)) / 2) << "\n";
  cin >> q;
  while (q--) {
    long long l, r, x;
    cin >> l >> r >> x;
    d -= max(0ll, query(1, 1, n, l) - query(1, 1, n, max(1ll, l - 1)));
    d -= max(0ll, query(1, 1, n, min(r + 1, n)) - query(1, 1, n, r));
    update(1, 1, n, l, r, x);
    d += max(0ll, query(1, 1, n, l) - query(1, 1, n, max(1ll, l - 1)));
    d += max(0ll, query(1, 1, n, min(r + 1, n)) - query(1, 1, n, r));
    cout << (((query(1, 1, n, 1) + d) + (abs(query(1, 1, n, 1) + d) % 2)) / 2)
         << "\n";
  }
  return 0;
}
