#include<bits/stdc++.h>
using namespace std;
using ll = long long;

// use 2^i size by yourself
// otherwise, maybe, it needs exchange law
/// --- SegmentTree Library {{{ ///

/*
   struct Monoid {
   using T = _underlying_set_;
   static T op(const T& a, const T& b) { return _a_op_b_; }
   static constexpr T identity() { return _identity_element_; }
   };
   */

template<class Monoid>
struct SegTree {
  private:
    using T = typename Monoid::T;
    const int n;
    vector<T> data;
    void propTo(int i) { data[i] = Monoid::op(data[2 * i], data[2 * i + 1]); }

  public:
    SegTree(int n, const T& v = Monoid::identity())
      : n(n),data(2 * n, v) {}

    template <class InputIt>
      SegTree(InputIt first, InputIt last)
      : n(distance(first, last)), data(2 * n, Monoid::identity()) {
        copy(first, last, begin(data) + n);
        // たぶん深いところから更新するため
        for(int i = n - 1; i > 0; i--) propTo(i);
      }

    void set(int i, const T& v) {
      data[i += n] = v;
      while(i >>= 1) propTo(i);
    }

    T get(int i) { return data[i + n]; }

    T query(int l, int r) {
      l = max(0, l); r = min(r, n);
      T tmpL = Monoid::identity(), tmpR = Monoid::identity();
      for(l += n, r += n; l < r; l >>= 1, r >>= 1) {
        if(l & 1) tmpL = Monoid::op(tmpL, data[l++]);
        if(r & 1) tmpR = Monoid::op(data[--r], tmpR);
      }
      return Monoid::op(tmpL, tmpR);
    }
};

struct RMQMonoid {
  using T = long long;
  static T op(const T& a, const T& b) { return std::min(a, b); }
  static constexpr T identity() { return numeric_limits<T>::max(); }
};
struct RSQMonoid {
  using T = long long;
  static T op(const T& a, const T& b) { return a + b; }
  static constexpr T identity() { return 0; }
};
struct RMaxQMonoid {
  using T = long long;
  static T op(const T& a, const T& b) { return std::max(a, b); }
  static constexpr T identity() { return numeric_limits<T>::min(); }
};

using RMQ = SegTree<RMQMonoid>;
using RSQ = SegTree<RSQMonoid>;
using RMaxQ = SegTree<RMaxQMonoid>;

/// }}}--- ///

int main() {
  ios::sync_with_stdio(false), cin.tie(0);
  int n, q; cin >> n >> q;
  n <<= 1;
  int m = 1;
  while(m < n) m <<= 1;
  vector<ll> a(n), b(n);
  RMaxQ treeone(m);
  for(int i = 0; i < n; i++) cin >> a[i];
  for(int i = 0; i < n; i++) cin >> b[i];
  int use = 0;
  ll now = 0;
  for(int i = 1; i < n - 1; i++) {
    now += max(a[i], b[i]);
    if(a[i] < b[i]) use ^= 1;
    treeone.set(i, -abs(a[i] - b[i]));
  }

  while(q--) {
    int i, x, y; cin >> i >> x >> y;
    i--;
    if(i == 0 || i == n - 1) {
    } else {
      now -= max(a[i], b[i]);
      if(a[i] < b[i]) use ^= 1;
      now += max(x, y);
      if(x < y) use ^= 1;
      treeone.set(i, -abs(y - x));
    }
    a[i] = x; b[i] = y;
    ll ans = a[0] + a[n - 1];
    ans += now;
    if(use) ans += treeone.query(1, n - 1);
    cout << ans << endl;
  }
}
