#include <bits/stdc++.h>
using namespace std;
const long long MaxN = 1e5 + 7;
const long long MaxM = 1e2 + 7;
const long long MDL = 1e9 + 7;
const long long INF = 1e18 + 7;
typedef long long arr[MaxN];
long long REPIT = 1;
const bool MQ = false;
long long n;
arr delta, so, fen;
long long divs(long long a) {
  if (a >= 0)
    return ((a + 1) / 2);
  else
    return (-(abs(a) / 2));
}
void build(long long pos, long long val) {
  for (long long i = pos; i <= n; i += (i & (-i))) fen[i] += val;
}
long long get(long long pos) {
  long long s = 0;
  for (long long i = pos; i > 0; i -= (i & (-i))) s += fen[i];
  return s;
}
void Solve() {
  cin >> n;
  for (long long i = 1; i <= n; ++i) cin >> so[i];
  long long diff = so[1];
  so[0] = 0;
  for (long long i = 2; i <= n; ++i)
    if (so[i] > so[i - 1]) diff += (so[i] - so[i - 1]);
  cout << divs(diff) << '\n';
  for (long long i = 1; i <= n; ++i) delta[i] = so[i] - so[i - 1];
  fill(fen, fen + n + 2, 0);
  for (long long i = 1; i <= n; ++i) build(i, delta[i]);
  long long q;
  cin >> q;
  while (q--) {
    long long l, r, u;
    cin >> l >> r >> u;
    if (l > 1 && delta[l] > 0)
      diff -= delta[l];
    else if (l == 1)
      diff -= delta[l];
    if (r < n && delta[r + 1] > 0) diff -= delta[r + 1];
    delta[l] += u, delta[r + 1] -= u;
    if (l > 1)
      diff += max(0LL, delta[l]);
    else
      diff += delta[l];
    if (r < n) diff += max(0LL, delta[r + 1]);
    cout << divs(diff) << '\n';
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  if (MQ == true) {
    cin >> REPIT;
    cin.ignore();
    ;
  }
  while (REPIT--) Solve();
  cout.flush();
}
