#include <bits/stdc++.h>
using namespace std;
int n, m, aa[200005], bb[200005], cc[200005];
map<int, int> check;
int main() {
  ios::sync_with_stdio(false);
  cin >> n;
  for (int i = 0; i < n; ++i) {
    cin >> aa[i];
    check[aa[i]]++;
  }
  cin >> m;
  for (int i = 0; i < m; ++i) cin >> bb[i];
  for (int i = 0; i < m; ++i) cin >> cc[i];
  int ans = 0;
  for (int i = 1; i < m; ++i) {
    if (check[bb[ans]] < check[bb[i]])
      ans = i;
    else if (check[bb[ans]] == check[bb[i]]) {
      if (check[cc[ans]] < check[cc[i]]) ans = i;
    }
  }
  cout << ans + 1;
}
