#include <bits/stdc++.h>
#define ff(i,a,b) for(int (i) = (a); (i) < (b); ++ (i))
#define pii pair<int,int>
#define pll pair<long long,long long>
#define pic pair<int,char>
#define FF(i,a,b) for(int (i) = (a); (i) > (b); -- (i))
#define xx first
#define yy second
#define pb push_back
#define ll long long
#define pqq priority_queue
using namespace std;
void solve(){
	int n;cin>>n;
	ff(i,1,n){
		int x,y;
		cin>>x>>y;
	}
	int maxi = INT_MIN;
	int id;
	ff(i,0,n){
		int smena;
		cin>>smena;
		if(smena>maxi){
		   maxi = smena;
		   id = i+1;	
		}
	}
	int q;cin>>q;
	ff(i,0,q){
		int z,b;cin>>z>>b;
	}
	cout<<id;
}
int main(){
	ios::sync_with_stdio(false);
    cin.tie(0);
    solve();
}