#include <bits/stdc++.h>
using namespace std;
int n, m, now, a[200009], b[200009], c[200009], d[3 * 200009], g[200009], mma,
    mmaa = -1, mano;
int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; i++) scanf("%d", &a[i]), d[++now] = a[i];
  scanf("%d", &m);
  for (int i = 1; i <= m; i++) scanf("%d", &b[i]), d[++now] = b[i];
  for (int i = 1; i <= m; i++) scanf("%d", &c[i]), d[++now] = c[i];
  sort(d + 1, d + now + 1);
  int num = unique(d + 1, d + n + 2 * m + 1) - d - 1;
  for (int i = 1; i <= n; i++) {
    a[i] = lower_bound(d + 1, d + num + 1, a[i]) - d;
    g[a[i]]++;
  }
  for (int i = 1; i <= m; i++) {
    b[i] = lower_bound(d + 1, d + num + 1, b[i]) - d;
  }
  for (int i = 1; i <= m; i++) {
    c[i] = lower_bound(d + 1, d + num + 1, c[i]) - d;
  }
  for (int i = 1; i <= m; i++) {
    if (g[b[i]] > mma) mma = g[b[i]];
  }
  for (int i = 1; i <= m; i++) {
    if (g[b[i]] == mma && g[c[i]] > mmaa) {
      mmaa = g[c[i]];
      mano = i;
    }
  }
  printf("%d\n", mano);
  return 0;
}
