#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pll pair <ll, ll>
#define ret return
#define pb push_back
#define all(x) x.begin(), x.end()
#define fr first
#define sc second
vector <long long> happy (int N, int Q, vector<int> u, vector<int> v, vector<int> h, vector<int> t, vector<int> l, vector<int> r) {
    vector <long long> open(N, 0), pref(N + 8, 0), suf(N + 8, 0), ans;
    long long d = 0;
    for(int i = 0; i < N; ++i) pref[v[i]] = pref[u[i]] + h[i];
    for(int i = 0; i < Q; ++i) {
        long long c = max((long long)0, d);
        if(t[i] == 1 && open[l[i]] == 0) {
            for(int i = 0; i < N; ++i) if(open[i] == 1) c += pref[max(i, l[i])] - pref[min(i, l[i])];
            ans.pb(c);
            open[l[i]] = 1;
        } else if(t[i] == 2 && open[l[i]] == 1) {
            open[l[i]] = 0;
            for(int i = 0; i < N; ++i) if(open[i] == 1) c -= pref[max(i, l[i])] - pref[min(i, l[i])];
            ans.pb(c);
        }
        d = c;
    }
}
int main() {
    ios::sync_with_stdio(0); cin.tie(0);

    int N,Q;
    cin >> N >> Q;
    vector <int> u(N),v(N),h(N),t(N),l(N),r(N);
    for(int i = 0; i < N; ++i) cin >> u[i];
    for(int i = 0; i < N; ++i) cin >> v[i];
    for(int i = 0; i < N; ++i) cin >> h[i];
    for(int i = 0; i < Q; ++i) cin >> t[i];
    for(int i = 0; i < Q; ++i) cin >> l[i];
    for(int i = 0; i < Q; ++i) cin >> r[i];
    vector <long long> a = happy(N, Q, u,v,h,t,l,r);
    for(auto x : a) cout << x << " ";
}

