#include <bits/stdc++.h>
using namespace std;
long long int power(long long int x, unsigned long long int y,
                    long long int p) {
  long long int res = 1;
  x = x % p;
  if (x == 0) return 0;
  while (y > 0) {
    if (y & 1) res = (res * x) % p;
    y = y >> 1;
    x = (x * x) % p;
  }
  return res;
}
signed main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  long long int n;
  cin >> n;
  vector<long long int> a(n);
  for (long long int k_ = 0; k_ < n; k_++) {
    cin >> a[k_];
  };
  long long int a0 = a[0];
  long long int k = 0;
  vector<long long int> diff(n);
  for (long long int i = 1; i < n; i++) {
    k += max(0LL, a[i] - a[i - 1]);
    diff[i] = a[i] - a[i - 1];
  }
  cout << (long long int)(ceil((a[0] + k) / (long double)2)) << "\n";
  long long int q;
  cin >> q;
  while (q--) {
    long long int l, r, x;
    cin >> l >> r >> x;
    l--;
    r--;
    if (l > 0) {
      k -= max(0LL, diff[l]);
      diff[l] += x;
      k += max(0LL, diff[l]);
    } else
      a0 += x;
    if (r < n - 1) {
      k -= max(0LL, diff[r + 1]);
      diff[r + 1] -= x;
      k += max(0LL, diff[r + 1]);
    }
    cout << (long long int)(ceil((a0 + k) / (long double)2)) << "\n";
  }
  return 0;
}
