#include <bits/stdc++.h>
using namespace std;
bool cmp(int a, int b) { return a > b; }
inline long long read() {
  long long 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 * 10 + ch - '0';
    ch = getchar();
  }
  return x * f;
}
long long n, a[100010], sum;
void work(long long po, long long x) {
  if (po > n) return;
  a[po] > 0 ? sum -= a[po] : 1;
  a[po] += x;
  a[po] > 0 ? sum += a[po] : 1;
}
int main() {
  n = read();
  for (int i = 1; i <= n; ++i) a[i] = read();
  for (int i = 2; i <= n; ++i)
    if (a[i] > a[i - 1]) sum += a[i] - a[i - 1];
  for (int i = n; i >= 1; --i) a[i] = a[i] - a[i - 1];
  long long a1 = a[1];
  printf("%lld\n", (long long)ceil(((sum + a1) / 2.0)));
  long long q = read();
  while (q--) {
    long long l = read(), r = read(), x = read();
    if (l == 1)
      a1 += x;
    else
      work(l, x);
    work(r + 1, -x);
    printf("%lld\n", (long long)ceil(((sum + a1) / 2.0)));
  }
  return 0;
}
