#include <bits/stdc++.h>
using namespace std;
void fun(long long l, long long x, long long &k, vector<long long> &a) {
  if (l >= (long long)a.size()) return;
  if (a[l] > 0) k -= a[l];
  a[l] += x;
  if (a[l] > 0) k += a[l];
}
void solve() {
  long long n;
  cin >> n;
  vector<long long> a(n);
  for (auto &x : a) cin >> x;
  ;
  long long k = 0, a1 = a[0];
  for (long long i = 1; i < n; i++) k += max((long long)0, a[i] - a[i - 1]);
  for (long long i = n - 1; i > 0; i--) a[i] = a[i] - a[i - 1];
  cout << (((a1 + k) % 2 and a1 + k > 0) ? ((a1 + k) / 2) + 1 : (a1 + k) / 2)
       << endl;
  long long q;
  cin >> q;
  while (q--) {
    long long l, r, x;
    cin >> l >> r >> x;
    l--;
    r--;
    if (l == 0)
      a1 += x;
    else
      fun(l, x, k, a);
    fun(r + 1, -x, k, a);
    cout << (((a1 + k) % 2 and a1 + k > 0) ? ((a1 + k) / 2) + 1 : (a1 + k) / 2)
         << endl;
  }
  return;
}
int main() {
  long long t = 1;
  while (t--) {
    solve();
  }
  return 0;
}
