#include <bits/stdc++.h>
using namespace std;
inline int gi() {
  int x = 0, f = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') f = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    x = (x << 3) + (x << 1) + (ch ^ 48);
    ch = getchar();
  }
  return (f == 1) ? x : -x;
}
inline long long max(long long a, long long b) { return a > b ? a : b; }
inline long long min(long long a, long long b) { return a < b ? a : b; }
const int maxn = 1e5 + 5;
long long a[maxn], b[maxn], n, m, l, r, x;
long long ans;
int main() {
  n = gi();
  for (int i = 1; i <= n; ++i) a[i] = gi(), b[i] = a[i] - a[i - 1];
  for (int i = 2; i <= n; ++i) ans += max(b[i], 0);
  printf("%lld\n", (long long)ceil((double)(a[1] + ans) / 2));
  m = gi();
  for (int i = 1; i <= m; ++i) {
    l = gi(), r = gi(), x = gi();
    if (l == 1) a[1] += x;
    if (b[l] > 0 && l > 1) ans -= b[l];
    if (b[r + 1] > 0 && r + 1 <= n) ans -= b[r + 1];
    b[l] += x, b[r + 1] -= x;
    if (l > 1) ans += max(0, b[l]);
    if (r + 1 <= n) ans = ans + max(0, b[r + 1]);
    printf("%lld\n", (long long)ceil((double)(a[1] + ans) / 2));
  }
  return 0;
}
