#include <bits/stdc++.h>
using namespace std;
const long long N = 1e6 + 7;
long long arr[N], diff[N], brr[N], n;
void p(long long x) {
  if (x & 1) {
    if (x < 0)
      x++;
    else
      x++;
  }
  cout << x / 2 << endl;
}
void solve() {
  cin >> n;
  for (long long i = 0; i < (long long)n; i++) cin >> arr[i], brr[i] = arr[i];
  for (long long i = 0; i < (long long)n - 1; i++)
    diff[i] = arr[i] - arr[i + 1];
  long long sum = 0;
  for (long long i = 0; i < (long long)n - 1; i++)
    if (diff[i] < 0) sum += abs(diff[i]);
  p(arr[0] + sum);
  long long q;
  cin >> q;
  while (q--) {
    long long a, b, x;
    cin >> a >> b >> x;
    a--;
    b--;
    if (a != 0) {
      a--;
      long long pd = diff[a];
      diff[a] -= x;
      if (pd < 0) sum -= abs(pd);
      if (diff[a] < 0) sum += abs(diff[a]);
      a++;
    }
    if (b + 1 < n) {
      long long pd = diff[b];
      diff[b] += x;
      if (pd < 0) sum -= abs(pd);
      if (diff[b] < 0) sum += abs(diff[b]);
    }
    if (a <= 0 and 0 <= b) arr[0] += x;
    p(arr[0] + sum);
  }
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  long long test = 1;
  while (test--) solve();
}
