#include <iostream>
#include <queue>
#include <functional>
#include <algorithm>
#include <cmath>
using namespace std;

long long n, q, p1, p2, p3, a[200009], b[200009], sum, cnt;
priority_queue<pair<long long, int>, vector<pair<long long, int>>, greater<pair<long long, int>>>Q;

int main() {
	cin >> n >> q;
	for (int i = 1; i <= 2 * n; i++) cin >> a[i];
	for (int i = 1; i <= 2 * n; i++) cin >> b[i];
	for (int i = 1; i <= 2 * n; i++) {
		if (i == 1)b[i] = -(1LL << 60); if (i == 2 * n) b[i] = -(1LL << 60);
		sum += max(a[i], b[i]);
		if (a[i] < b[i]) cnt++;
		Q.push(make_pair(max(a[i], b[i]) - min(a[i], b[i]), i));
	}
	for (int i = 1; i <= q; i++) {
		cin >> p1 >> p2 >> p3; if (p1 == 1) p3 = -(1LL << 60); if (p1 == 2 * n) p3 = -(1LL << 60);
		if (a[p1] < b[p1]) cnt--;
		sum -= max(a[p1], b[p1]);
		a[p1] = p2; b[p1] = p3;
		if (a[p1] < b[p1]) cnt++;
		sum += max(a[p1], b[p1]);
		Q.push(make_pair(abs(a[p1] - b[p1]), p1));
		while (!Q.empty()) {
			long long cost = Q.top().first, to = Q.top().second;
			long long V = abs(a[to] - b[to]);
			if (V != cost) Q.pop();
			else break;
		}
		if (cnt % 2 == 0) cout << sum << endl;
		else cout << sum - Q.top().first << endl;
	}
	return 0;
}