#include <bits/stdc++.h>
using namespace std;
template <typename AA>
inline void CMax(AA &u, AA v) {
  if (v > u) u = v;
}
template <typename AA>
inline void CMin(AA &u, AA v) {
  if (v < u) u = v;
}
const double Eps = 1E-8;
const int Inf = 0x3f3f3f3f, oo = 0x7fffffff, Mod = 1234567891;
const long long Lnf = 0x3f3f3f3f3f3f3f3f;
template <typename AA>
inline void read(AA &x) {
  int s = 0;
  char c;
  while (c = getchar(), (c < '0' || c > '9') && c != '-')
    ;
  c == '-' ? (s = 1, x = 0) : (x = c - '0');
  while (c = getchar(), c >= '0' && c <= '9') x = x * 10 + c - '0';
  if (s) x = -x;
}
template <typename AA>
void print(AA k) {
  int num = 0;
  static char stk[23];
  if (k < 0) {
    putchar('-');
    k = -k;
  }
  while (k > 0) stk[++num] = k % 10 + 48, k /= 10;
  if (!num)
    putchar('0');
  else
    while (num) putchar(stk[num--]);
  putchar('\n');
}
inline int Log2(int x) { return 31 - __builtin_clz(x); }
char getc() {
  char ch;
  do {
    ch = getchar();
  } while (ch == ' ' || ch == '\n');
  return ch;
}
long long Pow(long long d, long long m) {
  long long f = 1;
  while (m) {
    if (m & 1) f = f * d % Mod;
    d = d * d % Mod;
    m >>= 1;
  }
  return f;
}
int N, M, S, T, Q, K;
long long si[100010], d[100010];
int main() {
  read(N);
  for (int a = 1; a <= N; ++a) read(si[a]);
  si[0] = si[1];
  for (int a = 1; a <= N; ++a) d[a] = si[a] - si[a - 1];
  long long k1 = si[1], k2 = 0;
  for (int a = 1; a <= N; ++a)
    if (d[a] > 0) k2 += d[a];
  if (k1 + k2 > 0)
    print((k1 + k2 + 1) / 2);
  else
    print((k1 + k2) / 2);
  read(Q);
  for (int a = 1; a <= Q; ++a) {
    int l, r;
    long long x, la;
    scanf("%d%d%lld", &l, &r, &x);
    la = d[l];
    d[l] += x;
    if (l == 1) {
      d[l] = 0;
      k1 += x;
    } else {
      if (la >= 0 && d[l] >= 0)
        k2 += x;
      else if (la <= 0 && d[l] >= 0)
        k2 += d[l];
      else if (la >= 0 && d[l] <= 0)
        k2 -= la;
    }
    if (r < N) {
      la = d[r + 1];
      d[r + 1] -= x;
      if (la >= 0 && d[r + 1] >= 0)
        k2 -= x;
      else if (la <= 0 && d[r + 1] >= 0)
        k2 += d[r + 1];
      else if (la >= 0 && d[r + 1] <= 0)
        k2 -= la;
    }
    if (k1 + k2 > 0)
      print((k1 + k2 + 1) / 2);
    else
      print((k1 + k2) / 2);
  }
  return 0;
}
