#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
#include<queue>
#include<set>
#include<map>
#include<string>
#include<vector>
 
using namespace std;
 
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll, int> pli;
 
const int MX = 1<<19;
 
struct Tree{
	int t[MX*2];
	void update(int x, int v){
		x += MX; t[x] = v;
		while(x > 1){
			x /= 2;
			t[x] = min(t[x*2], t[x*2+1]);
		}
	}
	int read(int s, int e){
		s += MX, e += MX;
		int ans = 2e9;
		while(s <= e){
			if( s&1 ) ans = min(ans, t[s++]);
			if( ~e&1 ) ans = min(ans, t[e--]);
			s /= 2, e /= 2;
		}
		return ans;
	}
}mn;
 
struct BIT{
	ll t[MX];
	int read(int x){
		ll ans = 0;
		while(x){
			ans += t[x];
			x -= x&-x;
		}
		return ans;
	}
	void update(int x, int v){
		while(x < MX){
			t[x] += v; x += x&-x;
		}
	}
}sum;
 
int A[MX], B[MX];
 
int main()
{
	int N, Q, cnt = 0;
	ll ans = 0;
	scanf("%d%d", &N, &Q);
	for(int i = 1; i <= 2*N; i++) scanf("%d", A+i);
	for(int i = 1; i <= 2*N; i++) scanf("%d", B+i);
	for(int i = 2; i <= 2*N-1; i++) if( A[i] > B[i] ) cnt++;
	ans += A[1] + A[2*N];
	for(int i = 2; i <= 2*N-1; i++){
		mn.update(i, max(A[i], B[i]) - min(A[i], B[i]));
		ans += max(A[i], B[i]);
	}
 
	for(int i = 1; i <= Q; i++){
		int x, a, b;
		scanf("%d%d%d", &x, &a, &b);
		if( x == 1 || x == 2*N ) ans -= A[x];
		else{
			if( A[x] > B[x] ) cnt--;
			ans -= max(A[x], B[x]);
		}
		A[x] = a; B[x] = b;
		mn.update(x, max(a, b) - min(a, b));
		if( x == 1 || x == 2*N ) ans += A[x];
		else{
			if( A[x] > B[x] ) cnt++;
			ans += max(A[x], B[x]);
		}
		if( cnt%2 == 1 ) printf("%lld\n", ans - mn.read(2, 2*N-1));
		else printf("%lld\n", ans);
	}
}