#include <bits/stdc++.h>
using namespace std;
int readInt() {
  int f = 1, x = 0;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -f;
    c = getchar();
  }
  while (isdigit(c)) {
    x = x * 10 + (c - '0');
    c = getchar();
  }
  return f * x;
}
long long readLL() {
  long long f = 1, x = 0;
  char c = getchar();
  while (!isdigit(c)) {
    if (c == '-') f = -f;
    c = getchar();
  }
  while (isdigit(c)) {
    x = x * 10 + (c - '0');
    c = getchar();
  }
  return f * x;
}
const int INF = 0x3f3f3f3f;
long long qpow(long long a, long long b, long long mod) {
  if (a >= mod) a %= mod;
  long long res = 1;
  while (b) {
    if (b & 1) res = res * a % mod;
    a = a * a % mod;
    b >>= 1;
  }
  return res;
}
int n;
long long a[100005];
long long getsum(int i) {
  if (i == 1) return a[1];
  return max(0LL, a[i]);
}
void solve() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) scanf("%lld", &a[i]);
  for (int i = n; i >= 1; --i) a[i] -= a[i - 1];
  long long sum = 0;
  for (int i = 1; i <= n; ++i) sum += getsum(i);
  printf("%lld\n", (sum >= 0) ? ((sum + 1) / 2) : (sum / 2));
  int q;
  scanf("%d", &q);
  while (q--) {
    int l, r, x;
    scanf("%d%d%d", &l, &r, &x);
    sum -= getsum(l);
    a[l] += x;
    sum += getsum(l);
    if (r + 1 <= n) {
      sum -= getsum(r + 1);
      a[r + 1] -= x;
      sum += getsum(r + 1);
    }
    printf("%lld\n", (sum >= 0) ? ((sum + 1) / 2) : (sum / 2));
  }
}
int main() {
  int T = 1;
  for (int t = 1; t <= T; ++t) {
    solve();
  }
  return 0;
}
