#include <bits/stdc++.h>
using namespace std;
typedef struct film {
  long long audio_frq, sub_frq;
  int idx;
  film(){};
  film(long long a, long long b, int c) : audio_frq(a), sub_frq(b), idx(c){};
} film;
bool cmp(film a, film b) {
  if (a.audio_frq > b.audio_frq) return true;
  if (a.audio_frq == b.audio_frq && a.sub_frq > b.sub_frq) return true;
  return false;
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  scanf("%d", &n);
  map<long long, int> lang_freq;
  for (int i = 0; i < n; i++) {
    long long x;
    scanf("%lld", &x);
    lang_freq[x]++;
  }
  int m;
  scanf("%d", &m);
  vector<long long> a(m), b(m);
  for (int i = 0; i < m; i++) {
    scanf("%lld", &a[i]);
  }
  for (int i = 0; i < m; i++) {
    scanf("%lld", &b[i]);
  }
  vector<film> build(m);
  for (int i = 0; i < m; i++) {
    build[i] = film(lang_freq[a[i]], lang_freq[b[i]], i);
  }
  sort(build.begin(), build.end(), cmp);
  cout << build[0].idx + 1 << endl;
  return 0;
}
