#include <bits/stdc++.h>
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#pragma GCC optimize("Ofast")
using namespace std;
int n, m, num, numm, mx1 = -1, mx2 = -1, mx;
int a[200005], b[200005], c[200005], l[3 * 200005], ll[3 * 200005],
    st[3 * 200005];
inline int read();
int find(int x) { return lower_bound(ll + 1, ll + numm + 1, x) - ll; }
int main() {
  n = read();
  for (int i = 1; i <= n; ++i) l[++num] = a[i] = read();
  m = read();
  for (int i = 1; i <= m; ++i) l[++num] = b[i] = read();
  for (int i = 1; i <= m; ++i) l[++num] = c[i] = read();
  sort(l + 1, l + num + 1);
  for (int i = 1; i <= num; ++i)
    if (i == 1 || l[i] != l[i - 1]) ll[++numm] = l[i];
  for (int i = 1; i <= n; ++i) st[find(a[i])]++;
  for (int i = 1; i <= m; ++i) {
    int yy = st[find(b[i])], my = st[find(c[i])];
    if (yy > mx1) {
      mx1 = yy;
      mx2 = my;
      mx = i;
    } else if (yy == mx1 && my > mx2) {
      mx2 = my;
      mx = i;
    }
  }
  printf("%d", mx);
}
inline int read() {
  int s = 0, w = 1;
  char ch = getchar();
  while (ch < '0' || ch > '9') {
    if (ch == '-') w = -1;
    ch = getchar();
  }
  while (ch >= '0' && ch <= '9')
    s = (s << 3) + (s << 1) + ch - '0', ch = getchar();
  return s * w;
}
