#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5, mod = 998244353;
template <class o>
inline void qr(o &x) {
  x = 0;
  char c = getchar();
  int f = 1;
  while (c < '0' || c > '9') {
    if (c == '-') f = -1;
    c = getchar();
  }
  while (c >= '0' && c <= '9') {
    x = x * 10 + (c ^ 48);
    c = getchar();
  }
  x *= f;
}
template <class o>
void qw(o x) {
  if (x / 10) qw(x / 10);
  putchar(x % 10 + 48);
}
template <class o>
void pr1(o x) {
  if (x < 0) putchar('-'), x = -x;
  qw(x);
  putchar(' ');
}
template <class o>
void pr2(o x) {
  if (x < 0) putchar('-'), x = -x;
  qw(x);
  puts("");
}
long long a[N], w[N], sum;
void solve() {
  int n;
  qr(n);
  sum = 0;
  for (int i = 1; i <= n; ++i) qr(a[i]);
  w[1] = a[1];
  sum += w[1];
  for (int i = 2; i <= n; ++i)
    w[i] = a[i] - a[i - 1], sum += w[i] > 0 ? w[i] : 0;
  int m;
  qr(m);
  pr2(sum > 0 ? (sum + 1) / 2 : (sum / 2));
  for (int i = 1; i <= m; ++i) {
    int l, r, x;
    qr(l), qr(r), qr(x);
    if (l > 1 && w[l] > 0)
      sum -= w[l];
    else if (l == 1)
      sum -= w[l];
    w[l] += x;
    if (l > 1 && w[l] > 0)
      sum += w[l];
    else if (l == 1)
      sum += w[l];
    if (r < n) {
      ++r;
      if (w[r] > 0) sum -= w[r];
      w[r] -= x;
      if (w[r] > 0) sum += w[r];
    }
    pr2(sum > 0 ? (sum + 1) / 2 : (sum / 2));
  }
}
int main() {
  solve();
  return 0;
}
