#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1e5 + 1;
const int MOD = 1e9 + 7;
const int INF = 1e9;
const long long LINF = 1e18;
void solve() {
  int n;
  cin >> n;
  long long a[n];
  for (int i = 0; i < n; i++) cin >> a[i];
  long long diff[n - 1], sum = 0;
  for (int i = 0; i < n - 1; i++) {
    diff[i] = a[i + 1] - a[i];
    sum += max(diff[i], 0ll);
  }
  cout << (long long)ceil((double)(a[0] + sum) / 2) << "\n";
  int q;
  cin >> q;
  while (q--) {
    int l, r, v;
    cin >> l >> r >> v;
    l--;
    r--;
    if (l > 0) {
      sum -= max(diff[l - 1], 0ll);
      diff[l - 1] += v;
      sum += max(diff[l - 1], 0ll);
    }
    if (r < n - 1) {
      sum -= max(diff[r], 0ll);
      diff[r] -= v;
      sum += max(diff[r], 0ll);
    }
    if (l == 0) a[0] += v;
    cout << (long long)ceil((double)(a[0] + sum) / 2) << "\n";
  }
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  int tc;
  tc = 1;
  for (int t = 1; t <= tc; t++) {
    solve();
  }
}
