/+ dub.sdl:
    name "D"
    dependency "dcomp" version=">=0.7.4"
+/

import std.stdio, std.algorithm, std.range, std.conv;
// import dcomp.foundation, dcomp.scanner;

// import dcomp.tree.avl, dcomp.tree.primitive;
import std.container.rbtree;

int main() {
    Scanner sc = new Scanner(stdin);

    int n, q;
    sc.read(n, q); n*=2;
    long[] a, b;
    sc.read(a, b);

//    auto tr1 = new RedBlackTree!(long, "a<b", true);
//    auto tr2 = new RedBlackTree!(long, "a<b", true);
    auto tr1 = Tree!(AVLNode, long, max, long.min)();
    auto tr2 = Tree!(AVLNode, long, max, long.min)();
    void Ins(TR)(ref TR tr, long x) {
        tr.insert(tr.binSearchLeft!(y => x <= y)(0, tr.length), x);
    }
    void Rem(TR)(ref TR tr, long x) {
        tr.removeAt(tr.binSearchLeft!(y => x <= y)(0, tr.length));
    }
    long sm = a[0] + a[$-1];
    foreach (i; 1..n-1) {
        sm += max(a[i], b[i]);
        if (a[i] >= b[i]) {
//            tr1.insert(a[i] - b[i]);
            Ins(tr1, a[i] - b[i]);
        } else {
//            tr2.insert(b[i] - a[i]);
            Ins(tr2, b[i] - a[i]);
        }
    }
    
    foreach (i; 0..q) {
        int p; long x, y;
        sc.read(p, x, y); p--;
        if (p == 0 || p == n-1) {
            sm -= a[p];
        } else {
            sm -= max(a[p], b[p]);
            if (a[p] >= b[p]) {
//                tr1.removeKey(a[p] - b[p]);
                Rem(tr1, a[p] - b[p]);
            } else {
//                tr2.removeKey(b[p] - a[p]);
                Rem(tr2, b[p] - a[p]);
            }
        }
        a[p] = x; b[p] = y;
        if (p == 0 || p == n-1) {
            sm += a[p];
        } else {
            sm += max(a[p], b[p]);
            if (a[p] >= b[p]) {
                // tr1.insert(a[p] - b[p]);
                Ins(tr1, a[p] - b[p]);
            } else {
//                tr2.insert(b[p] - a[p]);
                Ins(tr2, b[p] - a[p]);
            }
        }
//        writeln("fi ", sm, " ", tr1, " ", tr2);
        long sm2 = sm;
        if (tr1.length % 2) {
            sm2 -= min(tr1[0], tr2[0]);
        }
        writeln(sm2);
    }
    return 0;
}
/* IMPORT /home/yosupo/Program/dcomp/source/dcomp/tree/avl.d */
// module dcomp.tree.avl;

// import dcomp.tree.primitive;

struct AVLNode(T, alias op, T e) {
    alias Node = typeof(this);
    import std.algorithm : max;
    import std.math : abs;
    Node*[2] ch;
    uint length; int lv;
    T v;
    this(in T v) {
        length = 1;
        this.v = v;
    }
    this(Node* l, Node* r) {
        ch = [l, r];
        update();
    }
    void update() {
        length = ch[0].length + ch[1].length;
        lv = max(ch[0].lv, ch[1].lv) + 1;
        v = op(ch[0].v, ch[1].v);
    }
     
     
    Node* rot(uint type) {
        assert(type == 0 || type == 1);
        auto buf = ch[type];
        ch[type] = buf.ch[1-type];
        buf.ch[1-type] = &this;
        update();
        buf.update();
        return buf;
    }
    Node* insert(uint k, in T v) {
        assert(0 <= k && k <= length);
        if (length == 1) {
            if (k == 0) {
                return new Node(new Node(v), &this);
            } else {
                return new Node(&this, new Node(v));
            }
        }

        int type;
        if (k < ch[0].length) {
            ch[0] = ch[0].insert(k, v);
            type = 0;
        } else {
            ch[1] = ch[1].insert(k-ch[0].length, v);
            type = 1;
        }
        update();
        if (abs(ch[0].lv - ch[1].lv) <= 1) return &this;
        if (lv - ch[type].ch[1-type].lv == 2 && lv - ch[type].ch[type].lv == 3) {
            ch[type] = ch[type].rot(1-type);
            update();
        }
        return rot(type);
    }
    Node* removeAt(uint k) {
        assert(0 <= k && k < length);
        if (length == 1) {
            return null;
        }
        int type;
        if (k < ch[0].length) {
            type = 0;
            ch[0] = ch[0].removeAt(k);
            if (ch[0] is null) return ch[1];
        } else {
            type = 1;
            ch[1] = ch[1].removeAt(k-ch[0].length);
            if (ch[1] is null) return ch[0];
        }
        update();
        if (abs(ch[0].lv - ch[1].lv) <= 1) return &this;
        if (lv - ch[1-type].ch[type].lv == 2 && lv - ch[1-type].ch[1-type].lv == 3) {
            ch[1-type] = ch[1-type].rot(type);
            update();
        }
        return rot(1-type);
    }
     
    const(T) at(uint k) const {
        assert(0 <= k && k < length);
        if (length == 1) return v;
        if (k < ch[0].length) return ch[0].at(k);
        return ch[1].at(k-ch[0].length);
    }
    const(T) sum(int a, int b) const {
        if (b <= 0 || length <= a) return e;
        if (a <= 0 && length <= b) return v;
        return op(ch[0].sum(a, b), ch[1].sum(a - ch[0].length, b - ch[0].length));
    }
}

import std.traits;

int binSearch(bool rev, alias pred, N)(N* r, int a, int b)
if (isInstanceOf!(AVLNode, N)) {
    alias args = TemplateArgsOf!N;
    alias opTT = args[1];
    auto x = args[2];
    with (r) {
        static if (!rev) {
             
            if (pred(x)) return a-1;
            int pos = a;
            void f(N* n, int a, int b, int offset) {
                if (b <= offset || offset + n.length <= a) return;
                if (a <= offset && offset + n.length <= b && !pred(opTT(x, n.v))) {
                    x = opTT(x, n.v);
                    pos = offset + n.length;
                    return;
                }
                if (n.length == 1) return;
                f(n.ch[0], a, b, offset);
                if (pos >= offset + n.ch[0].length) {
                    f(n.ch[1], a, b, offset + n.ch[0].length);
                }
            }

            f(r, a, b, 0);
            return pos;
        } else {
             

            if (pred(x)) return b;
            int pos = b-1;
            void f(N* n, int a, int b, int offset) {
                if (b <= offset || offset + n.length <= a) return;
                if (a <= offset && offset + n.length <= b && !pred(opTT(n.v, x))) {
                    x = opTT(n.v, x);
                    pos = offset - 1;
                    return;
                }
                if (n.length == 1) return;
                f(n.ch[1], a, b, offset + n.ch[0].length);
                if (pos < offset + n.ch[0].length) {
                    f(n.ch[0], a, b, offset);
                }
            }

            f(r, a, b, 0);
            return pos;
        }
    }
}

 
/* IMPORT /home/yosupo/Program/dcomp/source/dcomp/foundation.d */
// module dcomp.foundation;
 
static if (__VERSION__ <= 2070) {
    /*
    Copied by https://github.com/dlang/phobos/blob/master/std/algorithm/iteration.d
    Copyright: Andrei Alexandrescu 2008-.
    License: $(HTTP boost.org/LICENSE_1_0.txt, Boost License 1.0).
    */
    template fold(fun...) if (fun.length >= 1) {
        auto fold(R, S...)(R r, S seed) {
            import std.algorithm : reduce;
            static if (S.length < 2) {
                return reduce!fun(seed, r);
            } else {
                import std.typecons : tuple;
                return reduce!fun(tuple(seed), r);
            }
        }
    }
     
}

import core.bitop : popcnt;
static if (!__traits(compiles, popcnt(ulong.max))) {
    public import core.bitop : popcnt;
    int popcnt(ulong v) {
        return popcnt(cast(uint)(v)) + popcnt(cast(uint)(v>>32));
    }
}

bool poppar(ulong v) {
    v^=v>>1;
    v^=v>>2;
    v&=0x1111111111111111UL;
    v*=0x1111111111111111UL;
    return ((v>>60) & 1) != 0;
}
/* IMPORT /home/yosupo/Program/dcomp/source/dcomp/scanner.d */
// module dcomp.scanner;

// import dcomp.array;

 
class Scanner {
    import std.stdio : File;
    import std.conv : to;
    import std.range : front, popFront, array, ElementType;
    import std.array : split;
    import std.traits : isSomeChar, isStaticArray, isArray; 
    import std.algorithm : map;
    File f;
    this(File f) {
        this.f = f;
    }
    char[512] lineBuf;
    char[] line;
    private bool succW() {
        import std.range.primitives : empty, front, popFront;
        import std.ascii : isWhite;
        while (!line.empty && line.front.isWhite) {
            line.popFront;
        }
        return !line.empty;
    }
    private bool succ() {
        import std.range.primitives : empty, front, popFront;
        import std.ascii : isWhite;
        while (true) {
            while (!line.empty && line.front.isWhite) {
                line.popFront;
            }
            if (!line.empty) break;
            line = lineBuf[];
            f.readln(line);
            if (!line.length) return false;
        }
        return true;
    }

    private bool readSingle(T)(ref T x) {
        import std.algorithm : findSplitBefore;
        import std.string : strip;
        import std.conv : parse;
        if (!succ()) return false;
        static if (isArray!T) {
            alias E = ElementType!T;
            static if (isSomeChar!E) {
                 
                 
                auto r = line.findSplitBefore(" ");
                x = r[0].strip.dup;
                line = r[1];
            } else static if (isStaticArray!T) {
                foreach (i; 0..T.length) {
                    bool f = succW();
                    assert(f);
                    x[i] = line.parse!E;
                }
            } else {
                FastAppender!(E[]) buf;
                while (succW()) {
                    buf ~= line.parse!E;
                }
                x = buf.data;
            }
        } else {
            x = line.parse!T;
        }
        return true;
    }
    int read(T, Args...)(ref T x, auto ref Args args) {
        if (!readSingle(x)) return 0;
        static if (args.length == 0) {
            return 1;
        } else {
            return 1 + read(args);
        }
    }
}


 
 

 
/* IMPORT /home/yosupo/Program/dcomp/source/dcomp/tree/primitive.d */
// module dcomp.tree.primitive;

struct Tree(alias E, T, alias opTT, T _e) {
    immutable static T e = _e;
    import std.functional : binaryFun;
    import std.conv : to;
    import std.math : abs;    
    alias Engine = E!(T, binaryFun!opTT, e);
    Engine* tr;

    this(T v) {
        tr = new Engine(v);
    }

    @property size_t length() const { return (!tr ? 0 : tr.length); }
    alias opDollar = length;
    
    void insert(size_t k, in T v) {
        assert(0 <= k && k <= length);
        if (tr is null) {
            tr = new Engine(v);
            return;
        }
        tr = tr.insert(k.to!int, v);
    }
    void removeAt(size_t k) {
        assert(0 <= k && k < length);
        tr = tr.removeAt(k.to!int);
    }
    const(T) opIndex(size_t k) {
        assert(0 <= k && k < length);
        return tr.at(k.to!int);
    }
    struct Range {
        Tree* eng;
        size_t start, end;
        @property T sum() {
            return eng.tr.sum(start.to!uint, end.to!uint);
        }
    }
    size_t[2] opSlice(size_t dim)(size_t start, size_t end) {
        assert(0 <= start && start <= end && end <= length());
        return [start, end];
    }
    Range opIndex(size_t[2] rng) {
        return Range(&this, rng[0].to!uint, rng[1].to!uint);
    }
    string toString() {
         
        import std.range : iota;
        import std.algorithm : map;
        import std.conv : to;
        import std.string : join;
        string s;
        s ~= "Tree(";
        s ~= iota(length).map!(i => this[i]).to!string;
        s ~= ")";
        return s;
    }
}

import std.traits : isInstanceOf;
import std.conv : to;

ptrdiff_t binSearchLeft(alias pred, T)(T t, ptrdiff_t a, ptrdiff_t b)
if(isInstanceOf!(Tree, T)) {
    if (t.tr is null) {
        if (pred(T.e)) return -1;
        return 0;
    }
//     import dcomp.tree.avl;
    return t.tr.binSearch!(false, pred)(a.to!int, b.to!int);
}

ptrdiff_t binSearchRight(alias pred, T)(T t, ptrdiff_t a, ptrdiff_t b)
if(isInstanceOf!(Tree, T)) {
    if (t.tr is null) {
        if (pred(T.e)) return 0;
        return -1;
    }
//     import dcomp.tree.avl;
    return t.tr.binSearch!(true, pred)(a.to!int, b.to!int);
}
/* IMPORT /home/yosupo/Program/dcomp/source/dcomp/array.d */
// module dcomp.array;

 
T[N] fixed(T, size_t N)(T[N] a) {return a;}

 
 

 
struct FastAppender(A, size_t MIN = 4) {
    import std.algorithm : max;
    import std.conv;
    import std.range.primitives : ElementEncodingType;
    import core.stdc.string : memcpy;

    private alias T = ElementEncodingType!A;
    private T* _data;
    private uint len, cap;
     
    @property size_t length() const {return len;}
    bool empty() const { return len == 0; }
     
    void reserve(size_t nlen) {
        import core.memory : GC;
        if (nlen <= cap) return;
        
        void* nx = GC.malloc(nlen * T.sizeof);

        cap = nlen.to!uint;
        if (len) memcpy(nx, _data, len * T.sizeof);
        _data = cast(T*)(nx);
    }
    void free() {
        import core.memory : GC;
        GC.free(_data);
    }
     
    void opOpAssign(string op : "~")(T item) {
        if (len == cap) {
            reserve(max(MIN, cap*2));
        }
        _data[len++] = item;
    }
     
    void insertBack(T item) {
        this ~= item;
    }
     
    void removeBack() {
        len--;
    }
     
    void clear() {
        len = 0;
    }
    ref inout(T) back() inout { assert(len); return _data[len-1]; }
    ref inout(T) opIndex(size_t i) inout { return _data[i]; }
     
    T[] data() {
        return (_data) ? _data[0..len] : null;
    }
}

 
 

/*
This source code generated by dcomp and include dcomp's source code.
dcomp's Copyright: Copyright (c) 2016- Kohei Morita. (https://github.com/yosupo06/dcomp)
dcomp's License: MIT License(https://github.com/yosupo06/dcomp/blob/master/LICENSE.txt)
*/
