#include <bits/stdc++.h>
using namespace std;
const int MX = 1e5 + 233;
long long a[MX], del[MX], cost, n;
void upd(int pos, int v) {
  if (pos > n || pos == 1) return;
  long long before = max(del[pos], 0LL);
  del[pos] += v;
  cost += max(del[pos], 0LL) - before;
}
long long Ans(long long x) {
  if (x >= 0) return (x + 1) / 2;
  return x / 2;
}
void solve() {
  cost = 0;
  cin >> n;
  for (int i = 1; i <= n; ++i) {
    cin >> a[i];
    del[i] = a[i] - a[i - 1];
    if (i != 1 && del[i] >= 0) cost += del[i];
  }
  cout << Ans(a[1] + cost) << endl;
  int q;
  cin >> q;
  for (int i = 1; i <= q; ++i) {
    int l, r, d;
    cin >> l >> r >> d;
    if (l == 1)
      a[1] += d;
    else {
      upd(l, d);
    }
    if (r != n) {
      upd(r + 1, -d);
    }
    cout << Ans(a[1] + cost) << endl;
  }
}
int main() {
  int T = 1;
  while (T--) solve();
  return 0;
}
