#include <bits/stdc++.h>
using namespace std;
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ;
  int a;
  cin >> a;
  long long int arr[a];
  for (int i = 0; i < a; i++) {
    cin >> arr[i];
  }
  long long int diff[a];
  diff[0] = arr[0];
  long long int s = 0;
  for (int i = 1; i < a; i++) {
    diff[i] = arr[i] - arr[i - 1];
    if (diff[i] > 0) {
      s += diff[i];
    }
  }
  long long int x = (ceil)(((double)(arr[0] + s)) / 2.0);
  cout << x << endl;
  int q;
  cin >> q;
  while (q--) {
    int m, n, num;
    cin >> m >> n >> num;
    if (a == 1) {
      arr[0] += num;
      x = (ceil)(((double)arr[0]) / 2.0);
    } else if (m == n) {
      if (n == a) {
        if (diff[n - 1] > 0) s -= diff[n - 1];
        diff[n - 1] += num;
        if (diff[n - 1] > 0) s += diff[n - 1];
      } else {
        if (n != 1)
          if (diff[n - 1] > 0) s -= diff[n - 1];
        if (diff[n] > 0) s -= diff[n];
        if (n != 1) diff[n - 1] += num;
        diff[n] -= num;
        if (n != 1)
          if (diff[n - 1] > 0) s += diff[n - 1];
        if (diff[n] > 0) s += diff[n];
        if (n == 1) arr[0] += num;
      }
      x = (ceil)(((double)(arr[0] + s)) / 2.0);
    } else {
      if (m != 1) {
        if (diff[m - 1] > 0) s -= diff[m - 1];
        diff[m - 1] += num;
        if (diff[m - 1] > 0) s += diff[m - 1];
      }
      if (n == a) {
        arr[a - 1] += num;
      } else {
        if (diff[n] > 0) s -= diff[n];
        diff[n] -= num;
        if (diff[n] > 0) s += diff[n];
      }
      if (m == 1) arr[0] += num;
      x = (ceil)(((double)(arr[0] + s)) / 2.0);
    }
    cout << x << endl;
  }
}
