#include #define rep(i,n) for(int i=0; i<(int)(n); i++) using namespace std; using LL = long long; const int Max_N = 2e5; const int Max_M = 2e5; const LL Max_X = 1e9; const LL Max_V = 1e9; const int Max_K = 2e5; int main(){ int N, M; LL X; cin >> N >> M >> X; assert(1 <= N and N <= Max_N); assert(1 <= M and M <= Max_M); assert(0 <= X and X <= Max_X); vector V(N), G(N); rep(i,N){ LL v, g; cin >> v >> g; assert(0 <= v and v <= Max_V); //assert(1 <= g and g <= M); if(g <=0 or g > M){ cout << i + 1 << endl; cout << M << endl; return -1; } V[i] = v, G[i] = g; } int K; cin >> K; assert(1 <= K and K <= Max_K); vector p(K); rep(i,K){ int P; cin >> P; assert(0 <= P and P <= N); p[i] = P; } return 0; }