#include <bits/stdc++.h>

using namespace std;

#define DEBUG(x) cerr<<#x<<": "<<x<<endl;
#define DEBUG_VEC(v) cerr<<#v<<":";for(int i=0;i<v.size();i++) cerr<<" "<<v[i]; cerr<<endl

typedef long long ll;
#define vi vector<int>
#define vl vector<ll>
#define vii vector< vector<int> >
#define vll vector< vector<ll> >
#define vs vector<string>
#define pii pair<int,int>
#define pis pair<int,string>
#define psi pair<string,int>
#define pll pair<ll,ll>
template<class S, class T> pair<S, T> operator+(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first + t.first, s.second + t.second); }
template<class S, class T> pair<S, T> operator-(const pair<S, T> &s, const pair<S, T> &t) { return pair<S, T>(s.first - t.first, s.second - t.second); }
template<class S, class T> ostream& operator<<(ostream& os, pair<S, T> p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
#define X first
#define Y second
#define rep(i,n) for(int i=0;i<(n);i++)
#define rep1(i,n) for(int i=1;i<=(n);i++)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define rrep1(i,n) for(int i=(n);i>0;i--)
#define REP(i,a,b) for(int i=a;i<b;i++)
#define in(x, a, b) (a <= x && x < b)
#define all(c) c.begin(),c.end()
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a = b; return 1; } return 0; }
#define UNIQUE(v) v.erase(std::unique(v.begin(), v.end()), v.end());
const ll inf = 1000000001;
const ll INF = 1e18;
const ll MOD = 1000000007;
//const ll MOD = 998244353;
const double pi = 3.14159265358979323846;
#define Sp(p) cout<<setprecision(15)<< fixed<<p<<endl;
int dx[4] = { 1,0, -1,0 }, dy[4] = { 0,1,0,-1 };
int dx2[8] = { 1,1,0,-1,-1,-1,0,1 }, dy2[8] = { 0,1,1,1,0,-1,-1,-1 };
#define fio() cin.tie(0); ios::sync_with_stdio(false);
//#define mp make_pair

int main() {
  int n, q;
  cin >> n >> q;
  n *= 2;
  vl a(n), b(n);
  rep (i, n) {
    cin >> a[i];
  }
  rep (i, n) {
    cin >> b[i];
  }
  set<pii> aa, bb;
  ll ans = 0;
  rep (i, n) {
    if (i == 0) {
      ans += a[i];
      continue;
    }
    if (i == n - 1) {
      ans += a[i];
      continue;
    }
    if (a[i] >= b[i]) {
      ans += a[i];
      aa.insert(pii(a[i] - b[i], i));
    }
    else {
      ans += b[i];
      bb.insert(pii(b[i] - a[i], i));
    }
  }
  if ((int)aa.size() % 2) {
    assert(aa.begin()->first >= 0 || bb.begin()->first >= 0);
    auto itra = aa.begin();
    auto itrb = bb.begin();
    pii a_s = *itra, b_s = *itrb;
    if (a_s.first >= b_s.first) {
      bb.erase(b_s);
      int idx = b_s.second;
      ans -= b[idx];
      ans += a[idx];
      aa.insert(pii(a[idx] - b[idx], idx));
    }
    else {
      aa.erase(a_s);
      int idx = a_s.second;
      ans -= a[idx];
      ans += b[idx];
      bb.insert(pii(b[idx] - a[idx], idx));
    }
  }
  while (q--) {
    /*
    DEBUG(ans);
    cout << "aa ";
    for (auto itr = aa.begin(); itr != aa.end(); itr++) {
      cout << *itr << " ";
    }
    cout << endl;
    cout << "bb ";
    for (auto itr = bb.begin(); itr != bb.end(); itr++) {
      cout << *itr << " ";
    }
    //*/
    int p, x, y;
    cin >> p >> x >> y;
    p--;
    if (p == 0 || p == n - 1) {
      ans -= a[p];
      a[p] = x;
      b[p] = y;
      ans += a[p];
      cout << ans << endl;
      continue;
    }
    if (aa.count(pii(a[p] - b[p], p))) {
      aa.erase(pii(a[p] - b[p], p));
      ans -= a[p];
    }
    else if (bb.count(pii(b[p] - a[p], p))) {
      bb.erase(pii(b[p] - a[p], p));
      ans -= b[p];
    }
    else {
      assert(false);
    }
    a[p] = x;
    b[p] = y;
    if (a[p] >= b[p]) {
      ans += a[p];
      aa.insert(pii(a[p] - b[p], p));
    }
    else {
      ans += b[p];
      bb.insert(pii(b[p] - a[p], p));
    }
    if ((int)aa.size() % 2) {
      auto itra = aa.begin();
      auto itrb = bb.begin();
      pii a_s = *itra, b_s = *itrb;
      if (a_s.first >= b_s.first) {
        bb.erase(b_s);
        int idx = b_s.second;
        ans -= b[idx];
        ans += a[idx];
        aa.insert(pii(a[idx] - b[idx], idx));
      }
      else {
        aa.erase(a_s);
        int idx = a_s.second;
        ans -= a[idx];
        ans += b[idx];
        bb.insert(pii(b[idx] - a[idx], idx));
      }
    }
    if (aa.size() > 0 && bb.size() > 0) {
      pii a_s = *aa.begin(), b_s = *bb.begin();
      if (a_s.first + b_s.first < 0) {
        aa.erase(a_s);
        bb.erase(b_s);
        b_s.first *= -1;
        a_s.first *= -1;
        ans += b_s.first + a_s.first;
        aa.insert(b_s);
        bb.insert(a_s);
      }
    }
        
        
    cout << ans << endl;
  }
}
