#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 6;
int n;
long long a[N], c[N];
long long Q(long long x) { return x >= 0 ? x + 1 >> 1 : x / 2; }
int main() {
  scanf("%d", &n);
  long long s = 0;
  for (int i = 1; i <= n; ++i)
    scanf("%lld", &a[i]), s += i > 1 ? max(c[i] = a[i] - a[i - 1], 0LL) : 0;
  printf("%lld\n", Q(s + a[1]));
  int q;
  scanf("%d", &q);
  while (q--) {
    int l, r, x;
    scanf("%d%d%d", &l, &r, &x);
    if (l > 1) s -= max(c[l], 0LL), s += max(c[l] += x, 0LL);
    if (r < n) s -= max(c[r + 1], 0LL), s += max(c[r + 1] -= x, 0LL);
    if (l == 1) a[1] += x;
    printf("%lld\n", Q(s + a[1]));
  }
  return 0;
}
