#include <bits/stdc++.h>
using namespace std;
int main() {
  int n;
  cin >> n;
  long long int K = 0, x = 0;
  vector<long long int> a(n, 0);
  for (int i = 0; i < n; i++) cin >> a[i];
  for (int i = 0; i < n - 1; i++) {
    K += max(a[i + 1] - a[i], 0LL);
  }
  for (int i = n - 1; i >= 1; i--) {
    a[i] = a[i] - a[i - 1];
  }
  cout << (long long int)ceil((a[0] + K) / 2.00) << endl;
  int q;
  cin >> q;
  while (q--) {
    int l, r, x;
    cin >> l >> r >> x;
    l--, r--;
    if (l == 0) a[0] += x;
    if (l > 0) K -= max(0LL, a[l]), a[l] += x, K += max(0LL, a[l]);
    if (r < n - 1)
      K -= max(0LL, a[r + 1]), a[r + 1] -= x, K += max(0LL, a[r + 1]);
    cout << (long long int)ceil((a[0] + K) / 2.00) << endl;
  }
}
