#include <bits/stdc++.h>
using namespace std;
template <typename K, typename V, typename Hash = hash<K>,
          typename Pred = equal_to<K> >
using hashmap = unordered_map<K, V, Hash, Pred>;
template <typename K, typename Hash = hash<K>, typename Pred = equal_to<K> >
using hashset = unordered_set<K, Hash, Pred>;
template <class T>
vector<T> get_n_numbers_slowly(size_t n) {
  vector<T> result(n);
  copy_n(istream_iterator<T>(cin), n, result.begin());
  return result;
}
template <class T>
vector<T> get_n_numbers(size_t n) {
  vector<T> result(n);
  long long int buf;
  for (size_t i = 0; i < n; i++) {
    scanf("%llu", &buf);
    result[i] = buf;
  }
  return result;
}
template <class T>
T get_number() {
  vector<T> result = get_n_numbers<T>(1);
  return result[0];
}
template <class T,
          template <typename, typename = std::allocator<T> > class Container>
void printv(const Container<T> l) {
  copy(l.begin(), l.end(), ostream_iterator<T>(cerr, " "));
  cerr << endl;
}
long long int n;
long long int m;
long long int k;
vector<long long int> ranks;
vector<long long int> clubs;
vector<long long int> excls;
vector<long long int> mask;
hashmap<size_t, hashset<size_t> > club_to_rank;
hashmap<size_t, hashset<size_t> > rank_to_club;
hashmap<size_t, size_t> links;
hashset<size_t> vis;
inline void add_member(size_t idx) {
  club_to_rank[clubs[idx]].insert(ranks[idx]);
  rank_to_club[ranks[idx]].insert(clubs[idx]);
}
inline bool clearvis() {
  vis.clear();
  return true;
}
void print_hash(hashset<size_t>& h) {
  for (auto(i) = (h).begin(); (i) != (h).end(); (i)++) {
    cerr << *i << " ";
  }
  cerr << endl;
}
void print_hash(hashmap<size_t, hashset<size_t> >& h) {
  for (auto(i) = (h).begin(); (i) != (h).end(); (i)++) {
    cerr << i->first << ": ";
    print_hash(i->second);
  }
  cerr << endl;
}
bool search(long long int mex) {
  vis.insert(mex);
  if (!rank_to_club.count(mex)) return false;
  for (auto(i) = (rank_to_club[mex]).begin(); (i) != (rank_to_club[mex]).end();
       (i)++) {
    if (!links.count(*i)) {
      links[*i] = mex;
      return true;
    }
    if (!vis.count(links[*i]) && search(links[*i])) {
      links[*i] = mex;
      return true;
    }
  }
  return false;
}
long long int solution() {
  for (auto(i) = 0ULL; (i) < (n); (i)++) {
    if (!mask[i]) {
      add_member(i);
    }
  }
  long long int mex = 0;
  list<long long int> mexs;
  while (1) {
    while (mex < m && clearvis() && search(mex)) {
      mex++;
    }
    mexs.push_back(mex);
    if (excls.size() < 2) break;
    add_member(excls.back() - 1);
    excls.pop_back();
  }
  for (auto(i) = (mexs).rbegin(); (i) != (mexs).rend(); (i)++) {
    cout << *i << endl;
  }
  return 0LL;
}
int main(int argc, char** argv) {
  n = get_number<long long int>();
  m = get_number<long long int>();
  mask = vector<long long int>(n);
  ranks = get_n_numbers<long long int>(n);
  clubs = get_n_numbers<long long int>(n);
  k = get_number<long long int>();
  excls = get_n_numbers<long long int>(k);
  for (auto(i) = (excls).begin(); (i) != (excls).end(); (i)++) {
    mask[*i - 1] = 1;
  }
  solution();
  return 0;
}
