#include <bits/stdc++.h>
using namespace std;
const int mod = 1000 * 1000 * 1000 + 7;
const int INF = 1000 * 1000 * 1000;
const long long LINF = (long long)INF * INF;
int n, m, a[1000100], b[1000100], c[1000100];
vector<int> cor;
int cnt[1000100];
int32_t main(void) {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  ;
  cin >> n;
  for (int i = (0); i < (n); i++) {
    cin >> a[i];
    cor.push_back(a[i]);
  }
  cin >> m;
  for (int i = (0); i < (m); i++) {
    cin >> b[i];
    cor.push_back(b[i]);
  }
  for (int i = (0); i < (m); i++) {
    cin >> c[i];
    cor.push_back(c[i]);
  }
  sort((cor).begin(), (cor).end());
  cor.resize(unique((cor).begin(), (cor).end()) - cor.begin());
  for (int i = (0); i < (n); i++) {
    a[i] = (lower_bound((cor).begin(), (cor).end(), a[i]) - cor.begin());
    cnt[a[i]]++;
  }
  for (int i = (0); i < (m); i++) {
    b[i] = (lower_bound((cor).begin(), (cor).end(), b[i]) - cor.begin());
    c[i] = (lower_bound((cor).begin(), (cor).end(), c[i]) - cor.begin());
  }
  pair<int, int> mx = make_pair(-1, -1);
  int ans = 0;
  for (int i = (0); i < (m); i++) {
    pair<int, int> p = make_pair(cnt[b[i]], cnt[c[i]]);
    if (p > mx) {
      mx = p;
      ans = i + 1;
    }
  }
  cout << ans << '\n';
  return 0;
}
