#include <bits/stdc++.h>
using namespace std;
void solve() {
  int n, q;
  cin >> n;
  vector<long long int> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  vector<long long int> diff(n - 1, 0);
  long long int sumOfPositiveDiff = 0;
  for (int i = 1; i < n; i++) {
    diff[i - 1] = a[i] - a[i - 1];
    if (diff[i - 1] > 0) sumOfPositiveDiff += diff[i - 1];
  }
  long long int bFinalValue = a[0] + sumOfPositiveDiff;
  if (bFinalValue > 0) {
    cout << (bFinalValue + 1) / 2 << endl;
  } else {
    cout << (bFinalValue) / 2 << endl;
  }
  cin >> q;
  while (q--) {
    int l, r;
    long long int x;
    cin >> l >> r >> x;
    --l, --r;
    if (l > 0) {
      if (diff[l - 1] > 0) {
        sumOfPositiveDiff -= diff[l - 1];
      }
      diff[l - 1] += x;
      if (diff[l - 1] > 0) {
        sumOfPositiveDiff += diff[l - 1];
      }
    }
    if (r < n - 1) {
      if (diff[r] > 0) {
        sumOfPositiveDiff -= diff[r];
      }
      diff[r] -= x;
      if (diff[r] > 0) {
        sumOfPositiveDiff += diff[r];
      }
    }
    if (l == 0) a[0] += x;
    bFinalValue = a[0] + sumOfPositiveDiff;
    if (bFinalValue > 0) {
      cout << (bFinalValue + 1) / 2 << endl;
    } else {
      cout << (bFinalValue / 2) << endl;
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  solve();
}
