#include <bits/stdc++.h>
using namespace std;
pair<long long int, long long int> dxy[] = {{1, 0}, {0, 1}, {-1, 0}, {0, -1}};
const long long MAXN = 1e5 + 10, MOD = 1e9 + 7, INF = ((1ll << 60) - 1) * 2 + 1;
long long int n, m;
long long int t[4 * MAXN];
long long int a[4 * MAXN];
long long int arr[MAXN];
long long int d[MAXN];
void push(long long int v) {
  t[v] += a[v];
  if (v * 2 < 4 * MAXN) a[v * 2] += a[v];
  if (v * 2 + 1 < 4 * MAXN) a[v * 2 + 1] += a[v];
  a[v] = 0;
}
void ad(long long int v, long long int l0, long long int r0, long long int l,
        long long int r, long long int val) {
  if (r <= l) return;
  if (l0 == l && r0 == r) {
    a[v] += val;
    return;
  }
  long long int mid = (l0 + r0) >> 1;
  ad(v * 2, l0, mid, l, min(mid, r), val);
  ad(v * 2 + 1, mid, r0, max(mid, l), r, val);
}
long long int gt(long long int v, long long int l0, long long int r0,
                 long long int id) {
  push(v);
  if (l0 + 1 == r0) return t[v];
  long long int mid = (l0 + r0) >> 1;
  if (id < mid) return gt(v * 2, l0, mid, id);
  return gt(v * 2 + 1, mid, r0, id);
}
void build(long long int v, long long int l0, long long int r0) {
  if (l0 + 1 == r0) {
    t[v] = arr[l0];
    return;
  }
  long long int mid = (l0 + r0) >> 1;
  build(v * 2, l0, mid);
  build(v * 2 + 1, mid, r0);
}
void solve() {
  cin >> n;
  for (long long int i = 0; i < (n); ++i) cin >> arr[i];
  build(1, 0, n);
  long long int sumd = 0;
  for (long long int i = 1; i <= (n - 1); ++i) {
    d[i] = max(0ll, arr[i] - arr[i - 1]);
    sumd += d[i];
  }
  long long int sm = arr[0] + sumd;
  if (sm >= 0)
    cout << (sm + 1) / 2 << "\n";
  else
    cout << sm / 2 << "\n";
  cin >> m;
  while (m--) {
    long long int l, r, val;
    cin >> l >> r >> val;
    --l;
    ad(1, 0, n, l, r, val);
    if (l > 0) {
      sumd -= d[l];
      d[l] = max(0ll, gt(1, 0, n, l) - gt(1, 0, n, l - 1));
      sumd += d[l];
    } else
      arr[0] = gt(1, 0, n, 0);
    sumd -= d[r];
    d[r] = max(0ll, gt(1, 0, n, r) - gt(1, 0, n, r - 1));
    sumd += d[r];
    long long int sm = arr[0] + sumd;
    if (sm >= 0)
      cout << (sm + 1) / 2 << "\n";
    else
      cout << sm / 2 << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  solve();
}
