#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
int n;
long long a[N], dis[N];
void solve() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%lld", &a[i]);
  long long s = a[1];
  for (int i = 2; i <= n; i++)
    s += max(0LL, a[i] - a[i - 1]), dis[i] = a[i] - a[i - 1];
  if (s % 2 == 0)
    printf("%lld\n", s / 2LL);
  else
    printf("%lld\n", (s + 1) / 2LL);
  int q;
  scanf("%d", &q);
  while (q--) {
    int l, r, x;
    scanf("%d %d %d", &l, &r, &x);
    if (l == 1) {
      s += x;
    } else {
      s -= max(0LL, dis[l]);
      dis[l] += x;
      s += max(0LL, dis[l]);
    }
    if (r != n) {
      s -= max(0LL, dis[r + 1]);
      dis[r + 1] -= x;
      s += max(0LL, dis[r + 1]);
    }
    if (s % 2 == 0)
      printf("%lld\n", s / 2LL);
    else
      printf("%lld\n", (s + 1) / 2LL);
  }
}
int main() {
  solve();
  return 0;
}
