
N,Q =list(map(int,input().split()))
a= list(map(int,input().split()))
b=list(map(int,input().split()))


INF=-1E10

def calc(s,t):
    X=0
    for i in range(2*N):
        if s[i]==t[i]:
            X+=a[i]
        else:
            X+=b[i]

    return X
for p,x,y in [list(map(int,input().split())) for _ in range(Q)]:
    a[p-1]=x
    b[p-1]=y
    def get_dp(i,j):
        if 0<=i<2*N and 0 <=j<=i:
            return dp[i][j]
        return INF
    dp = [-INF for _ in range(2*N)]
    dp[0]=a[0]
    flag=False
    tmp=0
    X =a[0]+a[-1]
    for i in range(1,2*N-1):
        X+=max(a[i],b[i])
        if a[i]>b[i]:
            tmp+=1
        if a[i]==b[i]:
            flag=True

    if flag or tmp%2==0:
        print(X)
    else:
        print(X- min(abs(a[i]-b[i]) for i in range(1,2*N-1)))

