#include <bits/stdc++.h>
using namespace std;
const long long NINF = -1e9 + 10;
const long long PINF = 1e9 + 10;
long long sum;
long long n, A[100005];
void solve() {
  cin >> n;
  for (int i = 0; i < n; i++) {
    cin >> A[i];
  }
  long long sum = A[0];
  long long diff[n - 1];
  for (int i = 1; i < n; i++) {
    long long d = A[i] - A[i - 1];
    diff[i - 1] = d;
    if (d > 0) {
      sum += d;
    }
  }
  long long ans;
  if (sum > 0) {
    ans = (sum + 1) / 2;
  } else {
    ans = sum / 2;
  }
  cout << ans << endl;
  int q;
  cin >> q;
  while (q--) {
    int l, r;
    long long x;
    cin >> l >> r >> x;
    l--;
    r--;
    if (l > 0) {
      if (diff[l - 1] > 0) {
        sum -= diff[l - 1];
      }
      long long d1 = diff[l - 1] + x;
      if (d1 > 0) {
        sum += d1;
      }
      diff[l - 1] += x;
    }
    if (r != n - 1) {
      if (diff[r] > 0) {
        sum -= diff[r];
      }
      long long d1 = diff[r] - x;
      if (d1 > 0) {
        sum += d1;
      }
      diff[r] -= x;
    }
    if (l == 0) {
      sum += x;
      A[0] += x;
    }
    long long ans = 0;
    if (sum > 0) {
      ans = (sum + 1) / 2;
    } else {
      ans = (sum) / 2;
    }
    cout << ans << endl;
  }
}
int main() {
  solve();
  return 0;
}
