#include <bits/stdc++.h>
using namespace std;
inline long long read() {
  long long x = 0;
  int f = 0;
  char ch = getchar();
  while (ch < '0' || ch > '9') f |= (ch == '-'), ch = getchar();
  while (ch >= '0' && ch <= '9')
    x = (x << 3) + (x << 1) + ch - '0', ch = getchar();
  return x = f ? -x : x;
}
int lowbit(int x) { return x & (-x); }
template <class T>
T big(const T &a1, const T &a2) {
  return a1 > a2 ? a1 : a2;
}
template <class T>
T sml(const T &a1, const T &a2) {
  return a1 < a2 ? a1 : a2;
}
template <typename T, typename... R>
T big(const T &f, const R &...r) {
  return big(f, big(r...));
}
template <typename T, typename... R>
T sml(const T &f, const R &...r) {
  return sml(f, sml(r...));
}
void debug_out() { cout << '\n'; }
template <typename T, typename... R>
void debug_out(const T &f, const R &...r) {
  cout << f << " ";
  debug_out(r...);
}
const char ptout[] = "%d";
template <typename T>
void print(const T &f) {
  printf(ptout, f);
  putchar('\n');
}
template <typename T, typename... R>
void print(const T &f, const R &...r) {
  printf(ptout, f);
  putchar(' ');
  print(r...);
}
const int INF = 0x3f3f3f3f;
const int mod = 1e6 + 3;
const int MXN = 5e5 + 5;
const int MXE = 1e6 + 5;
int n, m;
long long ar[MXN], sum;
long long get_ans() { return sum > 0 ? (sum + 1) / 2 : sum / 2; }
void query(int a, int b, long long x) {
  if (a == 1 || ar[a] > 0) sum -= ar[a];
  ar[a] += x;
  if (a == 1 || ar[a] > 0) sum += ar[a];
  if (ar[b + 1] > 0 && b + 1 <= n) sum -= ar[b + 1];
  ar[b + 1] -= x;
  if (ar[b + 1] > 0 && b + 1 <= n) sum += ar[b + 1];
}
int main() {
  n = read();
  int las = 0;
  for (int i = 1; i <= n; ++i) {
    int x = read();
    ar[i] = x - las;
    las = x;
    if (i == 1 || ar[i] > 0) sum += ar[i];
  }
  printf("%lld\n", get_ans());
  m = read();
  while (m--) {
    int a = read(), b = read(), x = read();
    query(a, b, x);
    printf("%lld\n", get_ans());
  }
  return 0;
}
