import sys input = sys.stdin.readline from operator import itemgetter N,M,L,K=map(int,input().split()) C=[tuple(map(int,input().split())) for i in range(M)] T=[tuple(map(int,input().split())) for i in range(L)] mod=998244353 C.append((N,N)) FACT=[1] for i in range(1,5*10**5+1): FACT.append(FACT[-1]*i%mod) FACT_INV=[pow(FACT[-1],mod-2,mod)] for i in range(5*10**5,0,-1): FACT_INV.append(FACT_INV[-1]*i%mod) FACT_INV.reverse() def Combi(a,b): if 0<=b<=a: return FACT[a]*FACT_INV[b]%mod*FACT_INV[a-b]%mod else: return 0 C.sort(key=itemgetter(0)) T.sort(key=itemgetter(0)) for i in range(1,M+1): if C[i][1]