#include <bits/stdc++.h>
using namespace std;
const double eps = 1e-7;
const double PI = acos(-1);
const int MOD = 998244353;
const int INF = 0x3f3f3f3f;
const int N = 1e5 + 7;
template <typename T>
struct SegmentTree {
  int sz;
  T tr[N << 2], lazy[N << 2];
  SegmentTree() {}
  void build(const int &n, const T &k = 0) {
    sz = n;
    _build(1, n, k);
  }
  template <typename TT>
  void build(const TT a[], const int &n) {
    sz = n;
    _build(a, 1, n);
  }
  void modify(const int &x, const T &k) { _modify(x, k, 1, sz); }
  void add(const int &x, const T &k) { _add(x, x, k, 1, sz); }
  void add(int l, int r, const T &k) {
    if (l > r) swap(l, r);
    _add(l, r, k, 1, sz);
  }
  T query(const int &x) { return _query(x, x, 1, sz); }
  T query(int l, int r) {
    if (l > r) swap(l, r);
    return _query(l, r, 1, sz);
  }

 private:
  void push_up(const int &i) { tr[i] = tr[i << 1] + tr[i << 1 | 1]; }
  void push_down(const int &i, const int &len) {
    if (!lazy[i]) return;
    tr[i << 1] += lazy[i] * (len - len / 2);
    tr[i << 1 | 1] += lazy[i] * (len / 2);
    lazy[i << 1] += lazy[i];
    lazy[i << 1 | 1] += lazy[i];
    lazy[i] = 0;
  }
  void _build(const int &l, const int &r, const T &k = 0, const int &i = 1) {
    lazy[i] = 0;
    if (l == r) {
      tr[i] = k;
      return;
    }
    int mid = (l + r) >> 1;
    _build(l, mid, k, i << 1);
    _build(mid + 1, r, k, i << 1 | 1);
    push_up(i);
  }
  template <typename TT>
  void _build(const TT a[], const int &l, const int &r, const int &i = 1) {
    lazy[i] = 0;
    if (l == r) {
      tr[i] = a[l];
      return;
    }
    int mid = (l + r) >> 1;
    _build(a, l, mid, i << 1);
    _build(a, mid + 1, r, i << 1 | 1);
    push_up(i);
  }
  void _modify(const int &x, const T &k, const int &trl, const int &trr,
               const int &i = 1) {
    if (trl == x && trr == x) {
      tr[i] = k;
      lazy[i] = 0;
      return;
    }
    push_down(i, trr - trl + 1);
    int mid = (trl + trr) >> 1;
    if (x <= mid)
      _modify(x, k, trl, mid, i << 1);
    else
      _modify(x, k, mid + 1, trr, i << 1 | 1);
    push_up(i);
  }
  void _add(const int &l, const int &r, const T &k, const int &trl,
            const int &trr, const int &i = 1) {
    if (trl >= l && trr <= r) {
      tr[i] += k * (trr - trl + 1);
      lazy[i] += k;
      return;
    }
    push_down(i, trr - trl + 1);
    int mid = (trl + trr) >> 1;
    if (l <= mid) _add(l, r, k, trl, mid, i << 1);
    if (r > mid) _add(l, r, k, mid + 1, trr, i << 1 | 1);
    push_up(i);
  }
  T _query(const int &l, const int &r, const int &trl, const int &trr,
           const int &i = 1) {
    if (trl >= l && trr <= r) return tr[i];
    push_down(i, trr - trl + 1);
    int mid = (trl + trr) >> 1;
    T res = 0;
    if (l <= mid) res += _query(l, r, trl, mid, i << 1);
    if (r > mid) res += _query(l, r, mid + 1, trr, i << 1 | 1);
    return res;
  }
};
int n, q;
long long a[N], d[N], b[N];
SegmentTree<long long> btree;
inline void build() {
  for (int i = 1; i <= n; ++i) {
    d[i] = a[i] - a[i - 1];
    b[i] = max(0ll, d[i]);
  }
  b[1] = a[1];
  btree.build(b, n);
}
inline void modify(int l, int r, int x) {
  d[l] += x;
  d[r + 1] -= x;
  if (l == 1)
    btree.modify(1, d[l]);
  else
    btree.modify(l, max(0ll, d[l]));
  if (r < n) btree.modify(r + 1, max(0ll, d[r + 1]));
}
inline long long query() { return ceil(btree.query(1, n) / 2.0); }
signed main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  cout.tie(NULL);
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  build();
  cout << query() << endl;
  cin >> q;
  for (int i = 1, l, r, x; i <= q; ++i) {
    cin >> l >> r >> x;
    modify(l, r, x);
    cout << query() << endl;
  }
  return 0;
}
