#include <bits/stdc++.h>
using ll = long long;
using namespace std;
const int N = 1e5 + 5;
int n, q;
ll a[N], d[N], s;
void F(ll x) {
  if (x >= 0)
    printf("%lld\n", (x + 1) / 2);
  else
    printf("%lld\n", x / 2);
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%lld", a + i);
  for (int i = 1; i <= n - 1; ++i) {
    d[i] = a[i] - a[i + 1];
    if (d[i] > 0) s += d[i];
  }
  F(s + a[n]);
  scanf("%d", &q);
  while (q--) {
    int l, r, x;
    scanf("%d%d%d", &l, &r, &x);
    if (l != 1) {
      if (d[l - 1] > 0) s -= d[l - 1];
      d[l - 1] -= x;
      if (d[l - 1] > 0) s += d[l - 1];
    }
    if (r != n) {
      if (d[r] > 0) s -= d[r];
      d[r] += x;
      if (d[r] > 0) s += d[r];
    } else
      a[n] += x;
    F(s + a[n]);
  }
  return 0;
}
