#include <bits/stdc++.h>
using namespace std;
map<int, int> sci;
int n, m, idx;
pair<int, int> movie[200200], resp = pair<int, int>(-1, -1);
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n;
  ;
  for (int i = 1; i <= n; i++) {
    int x;
    cin >> x;
    if (sci.find(x) == sci.end())
      sci[x] = 1;
    else
      sci[x]++;
  }
  cin >> m;
  for (int i = 1; i <= m; i++) {
    int l;
    cin >> l;
    if (sci.find(l) == sci.end())
      movie[i].first = 0;
    else
      movie[i].first = sci[l];
  }
  for (int i = 1; i <= m; i++) {
    int s;
    cin >> s;
    if (sci.find(s) == sci.end())
      movie[i].second = 0;
    else
      movie[i].second = sci[s];
  }
  for (int i = 1; i <= m; i++)
    if (movie[i] > resp) {
      idx = i;
      resp = movie[i];
    }
  cout << idx << "\n";
  return 0;
}
