#include <bits/stdc++.h>
using namespace std;
priority_queue<int, vector<int>, greater<int> > p12;
priority_queue<int, vector<int>, greater<int> > p11;
priority_queue<int, vector<int>, greater<int> > p22;
priority_queue<int, vector<int>, greater<int> > p33;
priority_queue<int, vector<int>, greater<int> > p13;
priority_queue<int, vector<int>, greater<int> > p23;
int price[300000];
int fronta[300000];
int backa[300000], buyer[300000];
int main() {
  int n;
  scanf("%d", &n);
  for (int i = 0; i < n; ++i) {
    scanf("%d", &price[i]);
  }
  for (int i = 0; i < n; ++i) {
    scanf("%d", &fronta[i]);
  }
  for (int i = 0; i < n; ++i) {
    scanf("%d", &backa[i]);
  }
  int m;
  scanf("%d", &m);
  for (int i = 0; i < m; ++i) {
    scanf("%d", &buyer[i]);
  }
  p12.push(INT_MAX);
  p13.push(INT_MAX);
  p23.push(INT_MAX);
  p11.push(INT_MAX);
  p22.push(INT_MAX);
  p33.push(INT_MAX);
  for (int i = 0; i < n; ++i) {
    if (fronta[i] == 1 && backa[i] == 2 || fronta[i] == 2 && backa[i] == 1) {
      p12.push(price[i]);
    } else if (fronta[i] == 1 && backa[i] == 3 ||
               fronta[i] == 3 && backa[i] == 1) {
      p13.push(price[i]);
    } else if (fronta[i] == 2 && backa[i] == 3 ||
               fronta[i] == 3 && backa[i] == 2) {
      p23.push(price[i]);
    } else if (fronta[i] == 1 && backa[i] == 1) {
      p11.push(price[i]);
    } else if (fronta[i] == 2 && backa[i] == 2) {
      p22.push(price[i]);
    } else {
      p33.push(price[i]);
    }
  }
  int a, b, c;
  for (int i = 0; i < m; ++i) {
    if (buyer[i] == 1) {
      a = p12.top();
      b = p13.top();
      c = p11.top();
      if (min(a, min(b, c)) == INT_MAX) {
        printf("-1 ");
      } else {
        printf("%d ", min(a, min(b, c)));
        if (min(a, min(b, c)) == a)
          p12.pop();
        else if (min(a, min(b, c)) == b)
          p13.pop();
        else
          p11.pop();
      }
    }
    if (buyer[i] == 2) {
      a = p12.top();
      b = p23.top();
      c = p22.top();
      if (min(a, min(b, c)) == INT_MAX) {
        printf("-1 ");
      } else {
        printf("%d ", min(a, min(b, c)));
        if (min(a, min(b, c)) == a)
          p12.pop();
        else if (min(a, min(b, c)) == b)
          p23.pop();
        else
          p22.pop();
      }
    }
    if (buyer[i] == 3) {
      a = p23.top();
      b = p13.top();
      c = p33.top();
      if (min(a, min(b, c)) == INT_MAX) {
        printf("-1 ");
      } else {
        printf("%d ", min(a, min(b, c)));
        if (min(a, min(b, c)) == a)
          p23.pop();
        else if (min(a, min(b, c)) == b)
          p13.pop();
        else
          p33.pop();
      }
    }
  }
}
