#include <bits/stdc++.h>
using namespace std;
void err(istream_iterator<string> it) {}
template <typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args) {
  cerr << *it << " = " << a << endl;
  err(++it, args...);
}
inline int add(int a, int b) {
  a += b;
  return a >= 1000000007 ? a - 1000000007 : a;
}
inline int sub(int a, int b) {
  a -= b;
  return a < 0 ? a + 1000000007 : a;
}
inline int mul(int a, int b) { return (long long int)a * b % 1000000007; }
int Set(int N, int pos) { return N = N | (1 << pos); }
int Reset(int N, int pos) { return N = N & ~(1 << pos); }
bool Cheek(int N, int pos) { return (bool)(N & (1 << pos)); }
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
int my_rand(int l, int r) { return uniform_int_distribution<int>(l, r)(rng); }
long long int a[100005], dif[100005];
long long int b[100005], c[100005];
void Solve(int t) {
  long long int i, j, k, n, q, l, r, x, ans, difsum = 0, start;
  scanf("%lld", &(n));
  for (i = 1; i <= n; i++) {
    scanf("%lld", &(a[i]));
    dif[i] = a[i] - a[i - 1];
    if (i > 1) difsum += max(0LL, dif[i]);
  }
  start = dif[1];
  ans = ceil((double)(start + difsum) / 2.0);
  cout << ans << endl;
  scanf("%lld", &(q));
  for (i = 1; i <= q; i++) {
    scanf("%lld %lld", &(l), &(r));
    scanf("%lld", &(x));
    if (l == 1) {
      start += x;
    } else {
      if (dif[l] > 0) difsum -= dif[l];
      dif[l] += x;
      if (dif[l] > 0) difsum += dif[l];
    }
    r++;
    x *= -1;
    if (r <= n) {
      if (dif[r] > 0) difsum -= dif[r];
      dif[r] += x;
      if (dif[r] > 0) difsum += dif[r];
    }
    ans = ceil((double)(start + difsum) / 2.0);
    cout << ans << endl;
  }
}
int main() {
  int t, T;
  T = 1;
  for (__typeof(t) t = 1; t <= T; t++) {
    Solve(t);
  }
  return 0;
}
