#include #include #include using namespace std; int main(int argc, char* argv[]) { int N; cin>>N; vectorA(N),B(N); int i,j; for (i=0;i>A[i]>>B[i]; } int M; cin>>M; vector X(M),Y(M); for (j=0;j>X[j]>>Y[j]; } vector Num(M,0); for (i=0;i=B[i]){ Num[j]++; } } } int maxN=0; int maxJ=0; for (j=0;j> myMap; for (j=0;j>::value_type(Num[j],j+1)); } multimap>::iterator mit; int n=0; mit=myMap.begin(); cout<<(*mit).second<