#include <bits/stdc++.h>
const int MAXN = 1e5 * 7;
const int INF = 1e9 + 7;
const int N = 5000;
using namespace std;
int m, n, a[MAXN / 3], b[MAXN / 3], c[MAXN / 3], t[MAXN], d[MAXN];
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cin >> n;
  for (int i = 1; i <= n; ++i) cin >> a[i];
  cin >> m;
  for (int i = 1; i <= m; ++i) cin >> b[i];
  for (int i = 1; i <= m; ++i) cin >> c[i];
  for (int i = 1; i <= n; ++i) t[i] = a[i];
  for (int i = 1; i <= m; ++i) t[i + n] = b[i];
  for (int i = 1; i <= m; ++i) t[i + m + n] = c[i];
  int k = n + 2 * m;
  sort(t + 1, t + k + 1);
  for (int i = 1; i <= n; ++i) {
    int x = lower_bound(t + 1, t + k + 1, a[i]) - t;
    ++d[x];
  }
  int ans1 = 0, ans2 = 0, ans = 1;
  for (int i = 1; i <= m; ++i) {
    int x1 = lower_bound(t + 1, t + k + 1, b[i]) - t;
    int x2 = lower_bound(t + 1, t + k + 1, c[i]) - t;
    if (d[x1] > ans1) {
      ans1 = d[x1];
      ans2 = d[x2];
      ans = i;
    } else if (d[x1] == ans1 && ans2 < d[x2]) {
      ans2 = d[x2];
      ans = i;
    }
  }
  cout << ans;
  return 0;
}
