#include <bits/stdc++.h> using namespace std; int main() { int na,nb; map<int,int> ma,mb; cin>>na; while(na--) { int x,y; cin>>x>>y; ma[y]=x; } cin>>nb; while(nb--) { int x,y; cin>>x>>y; mb[y]=x; } int flag=0; for(int i=999;i&g...