import sys input = sys.stdin.readline N,M,X = map(int,input().split()) assert(1<=N<=2*10**5) assert(1<=M<=2*10**5) assert(0<=N<=10**9) for i in range(N): v,g = map(int,input().split()) assert(0<=v<=10**9) assert(1<=g<=M) K = int(input()) assert(1<=K<=2*10**5) p = list(map(int,input().split())) assert(len(p)==K) assert(all(0<=p[i]<=N for i in range(K)))