N,P,Q=map(int, input().split()) A=[] f=1 l,r=0,0 ll,rr=0,0 for i in range(N): x,a,b=map(int, input().split()) A.append((x,a,b)) if a+b