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

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int64 i = 0;i < (n);i++)
#define FOR(i, a, b) for(int64 i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
  return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value!=0>::type
fill_v(U &u,const V... v){u=U(v...);}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value==0>::type
fill_v(U &u,const V... v){
  for(auto &e:u) fill_v<T>(e,v...);
}

template<::std::uint_fast64_t mod>
class ModInt{
private:
    using value_type = ::std::uint_fast64_t;
    value_type n;
public:
    ModInt() : n(0) {}
    ModInt(value_type n_) : n(n_ % mod) {}
    ModInt(const ModInt& m) : n(m.n) {}

    template<typename T>
    explicit operator T() const { return static_cast<T>(n); }
    value_type get() const { return n; }

    friend ::std::ostream& operator<<(::std::ostream &os, const ModInt<mod> &a) {
        return os << a.n;
    }

    friend ::std::istream& operator>>(::std::istream &is, ModInt<mod> &a) {
        value_type x;
        is >> x;
        a = ModInt<mod>(x);
        return is;
    }

    bool operator==(const ModInt& m) const { return n == m.n; }
    bool operator!=(const ModInt& m) const { return n != m.n; }
    ModInt& operator*=(const ModInt& m){ n = n * m.n % mod; return *this; }

    ModInt pow(value_type b) const{
        ModInt ans = 1, m = ModInt(*this);
        while(b){
            if(b & 1) ans *= m;
            m *= m;
            b >>= 1;
        }
        return ans;
    }

    ModInt inv() const { return (*this).pow(mod-2); }
    ModInt& operator+=(const ModInt& m){ n += m.n; n = (n < mod ? n : n - mod); return *this; }
    ModInt& operator-=(const ModInt& m){ n += mod - m.n; n = (n < mod ? n : n - mod); return *this; }
    ModInt& operator/=(const ModInt& m){ *this *= m.inv(); return *this; }
    ModInt operator+(const ModInt& m) const { return ModInt(*this) += m; }
    ModInt operator-(const ModInt& m) const { return ModInt(*this) -= m; }
    ModInt operator*(const ModInt& m) const { return ModInt(*this) *= m; }
    ModInt operator/(const ModInt& m) const { return ModInt(*this) /= m; }
    ModInt& operator++(){ n += 1; return *this; }
    ModInt& operator--(){ n -= 1; return *this; }
    ModInt operator++(int){
        ModInt old(n);
        n += 1;
        return old;
    }
    ModInt operator--(int){
        ModInt old(n);
        n -= 1;
        return old;
    }
    ModInt operator-() const { return ModInt(mod-n); }
};

class UnionFind{
private:
    ::std::vector<int_fast32_t> par;
    vector<int64> sum;
    size_t n;

public:
    UnionFind(){}
    UnionFind(size_t n):n(n){
        par.resize(n, -1);
        sum.resize(n, 0);
    }

    void set_sum(const vector<int64>& s) {
        sum = s;
    }

    uint_fast32_t find(uint_fast32_t x){
        return par[x] < 0 ? x : par[x] = find(par[x]);
    }

    size_t size(uint_fast32_t x){
        return -par[find(x)];
    }

    int64 sum_v(int64 x) {
        return sum[find(x)];
    }

    bool unite(uint_fast32_t x, uint_fast32_t y){
        x = find(x);
        y = find(y);
        if(x == y) return false;
        if(size(x) < size(y)) std::swap(x, y);
        par[x] += par[y];
        sum[x] += sum[y];
        par[y] = x;
        return true;
    }

    bool same(uint_fast32_t x, uint_fast32_t y){
        return find(x) == find(y);
    }
};



int main(void) {
    int64 N, Q;
    cin >> N >> Q;
    N*=2;
    vector<int64> a(N), b(N);
    REP(i, N) cin >> a[i];
    REP(i, N) cin >> b[i];
    multiset<PLL> as, bs;
    vector<int64> wh(N);
    int64 res = a[0] + a.back();
    FOR(i, 1, N-1) {
        if (a[i] >= b[i]) {
            as.insert(PLL(a[i]-b[i], i));
            res += a[i];
            wh[i] = 0;
        } else {
            bs.insert(PLL(b[i]-a[i], i));
            res += b[i];
            wh[i] = 1;
        }
    }
    REP(i, Q) {
//        cout << endl;
        int64 p, x, y;
        cin >> p >> x >> y; p--;
        bool atob = 0, btoa = 0;
        if (p == 0 || p == N-1) {
            res -= a[p];
            a[p] = x; b[p] = y;
            res += a[p];
        } else {
            if (wh[p] == 0) {
                res -= a[p];
                as.erase(as.lower_bound(PLL(a[p]-b[p], p)));
            } else {
                res -= b[p];
                bs.erase(bs.lower_bound(PLL(b[p]-a[p], p)));
            }
            a[p] = x; b[p] = y;
            if (a[p] >= b[p]) {
                res += a[p];
                wh[p] = 0;
                as.insert(PLL(a[p]-b[p], p));
            } else {
                res += b[p];
                wh[p] = 1;
                bs.insert(PLL(b[p]-a[p], p));
            }
//            cout << res << endl;
            if (as.size() % 2) {
                auto ia = *as.begin(), ib = *bs.begin();
                if (ia.fs >= ib.fs) {
                    res -= ib.fs;
                    wh[ib.sc] = 0;
                    as.insert(PLL(-ib.fs, ib.sc));
                    bs.erase(bs.begin());
                    btoa = 1;
                } else {
                    res -= ia.fs;
                    wh[ia.sc] = 1;
                    bs.insert(PLL(-ia.fs, ia.sc));
                    as.erase(as.begin());
                    atob = 1;
                }
            }
        }
//        for (auto x : as) {
//            cout << x.fs << " ";
//        }
//        cout << endl;
//        for (auto x : bs) {
//            cout << x.fs << " ";
//        }
//        cout << endl;
        cout << res << endl;
        if (atob) {
            auto b = *bs.begin();
            wh[b.sc] = 0;
            res -= b.fs;
            as.insert(PLL(-b.fs, b.sc));
            bs.erase(bs.begin());
        } else if (btoa) {
            auto b = *as.begin();
            wh[b.sc] = 1;
            res -= b.fs;
            bs.insert(PLL(-b.fs, b.sc));
            as.erase(as.begin());
        }
    }
}
