#include <bits/stdc++.h>
using namespace std;
int func(int x) { return x >= 0 ? 1 : -1; }
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int n;
  cin >> n;
  long long data[n], diff[n];
  for (int x = 0; x < n; x++) {
    cin >> data[x];
    if (x > 0) diff[x] = data[x] - data[x - 1];
  }
  diff[0] = data[0];
  long long point = 0;
  for (int x = 1; x < n; x++) {
    if (diff[x] > 0) {
      point += diff[x];
    }
  }
  long long total = diff[0] + point;
  if (total >= 0)
    cout << (total + 1) / 2 << "\n";
  else
    cout << total / 2 << '\n';
  int q;
  cin >> q;
  while (q--) {
    int l, r;
    long long m;
    cin >> l >> r >> m;
    if (l > 1 && diff[l - 1] > 0) {
      point -= diff[l - 1];
    }
    diff[l - 1] += m;
    if (l > 1 && diff[l - 1] > 0) point += diff[l - 1];
    if (r < n) {
      if (diff[r] > 0) {
        point -= diff[r];
      }
      diff[r] -= m;
      if (diff[r] > 0) point += diff[r];
    }
    long long total = diff[0] + point;
    if (total >= 0)
      cout << (total + 1) / 2 << "\n";
    else
      cout << total / 2 << '\n';
  }
  return 0;
}
