#include <bits/stdc++.h>
using namespace std;
int read() {
  int xx = 0, ff = 1;
  char ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') ff = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    xx = xx * 10 + ch - '0';
    ch = getchar();
  }
  return xx * ff;
}
long long READ() {
  long long xx = 0, ff = 1;
  char ch = getchar();
  while (ch > '9' || ch < '0') {
    if (ch == '-') ff = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9') {
    xx = xx * 10 + ch - '0';
    ch = getchar();
  }
  return xx * ff;
}
char one() {
  char ch = getchar();
  while (ch == ' ' || ch == '\n' || ch == '\r') ch = getchar();
  return ch;
}
const int maxn = 100010;
int n;
long long ans, sum, x, d[maxn], a[maxn];
int main() {
  n = read();
  for (int i = 1; i <= n; i++) {
    a[i] = read();
    d[i - 1] = a[i] - a[i - 1];
  }
  for (int i = 1; i < n; i++) sum += max(0LL, d[i]);
  x = (a[1] + sum) / 2;
  ans = max(x, a[1] + sum - x);
  printf("%I64d\n", ans);
  for (int _ = read(); _; _--) {
    int L = read(), R = read(), X = read();
    if (L == 1) a[1] += X;
    if (L > 1) sum -= max(0LL, d[L - 1]);
    if (R < n) sum -= max(0LL, d[R]);
    d[L - 1] += X;
    d[R] -= X;
    if (L > 1) sum += max(0LL, d[L - 1]);
    if (R < n) sum += max(0LL, d[R]);
    x = (a[1] + sum) / 2;
    ans = max(x, a[1] + sum - x);
    printf("%I64d\n", ans);
  }
  return 0;
}
