There are n squares drawn from left to right on the floor. The i-th square has three integers p_i,a_i,b_i, written on it. The sequence p_1,p_2,...,p_n forms a permutation.

Each round you will start from the leftmost square 1 and jump to the right. If you are now on the i-th square, you can do one of the following two operations:

  1. Jump to the i+1-th square and pay the cost a_i. If i=n, then you can end the round and pay the cost a_i. 
  2. Jump to the j-th square and pay the cost b_i, where j is the leftmost square that satisfies j > i, p_j > p_i. If there is no such j then you can end the round and pay the cost b_i. 



There are q rounds in the game. To make the game more difficult, you need to maintain a square set S (initially it is empty). You must pass through these squares during the round (other squares can also be passed through). The square set S for the i-th round is obtained by adding or removing a square from the square set for the (i-1)-th round. 

For each round find the minimum cost you should pay to end it.

Input

The first line contains two integers n, q (1≤ n,q≤ 2 ⋅ 10^5) — the number of squares and the number of rounds.

The second line contains n distinct integers p_1,p_2,...,p_n (1≤ p_i≤ n). It is guaranteed that the sequence p_1,p_2,...,p_n forms a permutation.

The third line contains n integers a_1,a_2,…,a_n (-10^9≤ a_i≤ 10^9).

The fourth line contains n integers b_1,b_2,...,b_n (-10^9≤ b_i≤ 10^9).

Then q lines follow, i-th of them contains a single integer x_i (1≤ x_i≤ n). If x_i was in the set S on the (i-1)-th round you should remove it, otherwise, you should add it.

Output

Print q lines, each of them should contain a single integer — the minimum cost you should pay to end the corresponding round.

Examples

Input


3 2
2 1 3
10 -5 4
3 -2 3
1
2


Output


6
8


Input


5 4
2 1 5 3 4
6 -5 3 -10 -1
0 3 2 7 2
1
2
3
2


Output


-8
-7
-7
-8

Note

Let's consider the character T as the end of a round. Then we can draw two graphs for the first and the second test.

<image> <image>

In the first round of the first test, the set that you must pass through is \{1\}. The path you can use is 1→ 3→ T and its cost is 6.

In the second round of the first test, the set that you must pass through is \{1,2\}. The path you can use is 1→ 2→ 3→ T and its cost is 8.
#include <bits/stdc++.h>
using namespace std;
#ifdef LOCAL
string to_string(string s) { return '"' + s + '"'; }
string to_string(const char* s) { return to_string(string(s)); }
string to_string(bool b) { return to_string(int(b)); }
string to_string(vector<bool>::reference b) { return to_string(int(b)); }
string to_string(char b) { return "'" + string(1, b) + "'"; }
template <typename A, typename B>
string to_string(pair<A, B> p) { return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; }
template <typename A>
string to_string(A v) {
	string res = "{";
	for (const auto& x : v) res += (res == "{" ? "" : ", ") + to_string(x);
	return res + "}";
}
void debug() { cerr << endl; }
template <typename Head, typename... Tail>
void debug(Head H, Tail... T) {
	cerr << " " << to_string(H);
	debug(T...);
}
#define db(...) cerr << "[" << #__VA_ARGS__ << "]:", debug(__VA_ARGS__)
#else
#define db(...) 42
#endif
typedef long long ll;
typedef long double ld;
struct SegTree {
	struct Node {
		ll x = 0; // Set default value here
		ll prop = 0;
		// Used for updates and propagation.
		void apply(int s, int e, ll v) {
			x += v;
			prop += v;
		}
	};
	inline Node combine(const Node& a, const Node& b) {
		Node res;
		res.x = max(a.x, b.x);
		return res;
	}
	inline void push(int sn, int s, int e) {
		if (tree[sn].prop) {
			int m = (s + e) >> 1, lsn = sn * 2, rsn = sn * 2 + 1;
			tree[lsn].apply(s, m, tree[sn].prop);
			tree[rsn].apply(m + 1, e, tree[sn].prop);
			tree[sn].prop = 0;
		}
	}
	int start, end;
	vector<Node> tree;
	void build(int sn, int s, int e) {
		if (s == e) {
			// initialize here, possibly.
			return;
		}
		int m = (s + e) >> 1, lsn = sn * 2, rsn = sn * 2 + 1;
		build(lsn, s, m);
		build(rsn, m + 1, e);
		tree[sn] = combine(tree[lsn], tree[rsn]);
	}
	template <typename T>
	void build(int sn, int s, int e, const vector<T>& v) {
		if (s == e) {
			tree[sn].x = v[s];
			return;
		}
		int m = (s + e) >> 1, lsn = sn * 2, rsn = sn * 2 + 1;
		build(lsn, s, m, v);
		build(rsn, m + 1, e, v);
		tree[sn] = combine(tree[lsn], tree[rsn]);
	}
	template <typename... T>
	void update(int sn, int s, int e, int qs, int qe, const T&... v) {
		if (qs <= s && e <= qe) {
			tree[sn].apply(s, e, v...);
			return;
		}
		int m = (s + e) >> 1, lsn = sn * 2, rsn = sn * 2 + 1;
		push(sn, s, e);
		if (qs <= m) update(lsn, s, m, qs, qe, v...);
		if (qe > m) update(rsn, m + 1, e, qs, qe, v...);
		tree[sn] = combine(tree[lsn], tree[rsn]);
	}
	Node query(int sn, int s, int e, int qs, int qe) {
		if (qs <= s && e <= qe) return tree[sn];
		int m = (s + e) >> 1, lsn = sn * 2, rsn = sn * 2 + 1;
		push(sn, s, e);
		if (qe <= m) return query(lsn, s, m, qs, qe);
		if (qs > m) return query(rsn, m + 1, e, qs, qe);
		return combine(query(lsn, s, m, qs, qe), query(rsn, m + 1, e, qs, qe));
	}
	void query(int sn, int s, int e, int qs, int qe, const function<void(Node&, int, int)>& f) {
		if (qs <= s && e <= qe) return f(tree[sn], s, e);
		int m = (s + e) >> 1, lsn = sn * 2, rsn = sn * 2 + 1;
		push(sn, s, e);
		if (qs <= m) query(lsn, s, m, qs, qe, f);
		if (qe > m) query(rsn, m + 1, e, qs, qe, f);
	}
	SegTree(int n) : SegTree(0, n - 1) {}
	SegTree(int _start, int _end) : start(_start), end(_end) {
		int n = end - start + 1;
		int maxs = n == 1 ? 2 : 1 << (33 - __builtin_clz(n - 1));
		tree.resize(maxs);
		build(1, start, end);
	}
	template <typename T>
	SegTree(const vector<T>& v) {
		int n = v.size();
		int maxs = n == 1 ? 2 : 1 << (33 - __builtin_clz(n - 1));
		tree.resize(maxs);
		start = 0;
		end = n - 1;
		build(1, start, end, v);
	}
	Node query(int qs, int qe) {
		return query(1, start, end, qs, qe);
	}
	Node query(int p) {
		return query(1, start, end, p, p);
	}
	void query(int qs, int qe, const function<void(Node&, int, int)>& f) {
		if (qs > qe) return;
		query(1, start, end, qs, qe, f);
	}
	template <typename... T>
	void update(int qs, int qe, const T&... v) {
		update(1, start, end, qs, qe, v...);
	}
};
int main() {
	int n, q;
	scanf("%d%d", &n, &q);
	vector<int> A(n), B(n), P(n + 1, n + 1), X(q);
	for (int i = 0; i < n; ++i) scanf("%d", &P[i]);
	for (int i = 0; i < n; ++i) scanf("%d", &A[i]);
	for (int i = 0; i < n; ++i) scanf("%d", &B[i]);
	set<int> S = {0, n};
	vector<set<int>> starts(n + 1);
	starts[n].insert(0);
	for (int i = 0; i < q; ++i) {
		scanf("%d", &X[i]);
		--X[i];
		if (!X[i]) continue;
		if (S.count(X[i])) {
			auto it = S.lower_bound(X[i]);
			auto pit = prev(it), nit = next(it);
			starts[*it].insert(*pit);
			starts[*nit].insert(*it);
			S.erase(it);
			starts[*nit].insert(*pit);
		} else {
			auto nit = S.lower_bound(X[i]);
			auto pit = prev(nit);
			starts[*nit].insert(*pit);
			S.insert(X[i]);
			starts[X[i]].insert(*pit);
			starts[*nit].insert(X[i]);
		}
	}
	SegTree st(n);
	map<pair<int, int>, ll> val;
	vector<int> vec = {0};
	for (int i = 1; i <= n; ++i) {
		st.update(0, i - 1, A[i - 1]);
		while (!vec.empty() && P[vec.back()] < P[i]) {
			int p = vec.back();
			vec.pop_back();
			ll v = st.query(p).x;
			if (B[p] < v) {
				st.update(0, p, B[p] - v);
			}
		}
		vec.push_back(i);
		for (int start : starts[i]) {
			val[{start, i}] = st.query(start).x;
		}
	}
	db(val);
	S = {0, n};
	ll ans = val[{0, n}];
	for (int i = 0; i < q; ++i) {
		if (X[i]) {
			if (S.count(X[i])) {
				auto it = S.lower_bound(X[i]);
				auto pit = prev(it), nit = next(it);
				ans -= val[{*pit, *it}] + val[{*it, *nit}];
				S.erase(it);
				ans += val[{*pit, *nit}];
			} else {
				auto nit = S.lower_bound(X[i]);
				auto pit = prev(nit);
				ans -= val[{*pit, *nit}];
				S.insert(X[i]);
				ans += val[{*pit, X[i]}] + val[{X[i], *nit}];
			}
		}
		printf("%lld\n", ans);
	}
}

