#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
int a[N], n, q;
long long sum, c[N], a1;
inline void modify(int x, int z) {
  if (x > n) return;
  if (c[x] > 0) sum -= c[x];
  c[x] += z;
  if (c[x] > 0) sum += c[x];
}
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), c[i] = a[i] - a[i - 1];
  for (int i = 2; i <= n; i++) sum += c[i] > 0 ? c[i] : 0;
  a1 = c[1];
  scanf("%d", &q);
  printf("%lld\n", (long long)ceil((a1 + sum) / 2.0));
  while (q--) {
    int l, r, x;
    scanf("%d%d%d", &l, &r, &x);
    if (l == 1)
      a1 += x;
    else
      modify(l, x);
    modify(r + 1, -x);
    printf("%lld\n", (long long)ceil((a1 + sum) / 2.0));
  }
  return 0;
}
