#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
long long BLOCK;
long long i, j, k, l, n, m, ans = 0;
long long a[100009], f[100009];
int main() {
  ios_base::sync_with_stdio(false), cin.tie(0), cout.tie(0);
  cin >> n;
  for (i = 1; i <= n; i++) {
    cin >> a[i];
    f[i] = a[i] - a[i - 1];
    if (i == 1)
      ans += f[i];
    else
      ans += max(0ll, f[i]);
  }
  if (ans >= 0)
    cout << (ans + 1) / 2 << '\n';
  else
    cout << ans / 2 << '\n';
  cin >> m;
  for (i = 1; i <= m; i++) {
    cin >> k >> l >> j;
    if (k == 1) {
      ans -= f[1];
      f[1] += j;
      ans += f[1];
    } else {
      ans -= max(0ll, f[k]);
      f[k] += j;
      ans += max(0ll, f[k]);
    }
    if (l != n) {
      ans -= max(0ll, f[l + 1]);
      f[l + 1] -= j;
      ans += max(0ll, f[l + 1]);
    }
    if (ans >= 0)
      cout << (ans + 1) / 2 << '\n';
    else
      cout << ans / 2 << '\n';
  }
  exit(0);
}
