I,R,=input,range S,N,B,x=R(3),R(2),[0]*6,[0]*4 def J(): return list(map(int,I().split())) def U(): global a s,b,c=sum(x),1,0 for j in R(4):b,c=b*(x[j]>=0),c+x[j]*X[j] for j in S:b*=s-x[j]<=B[j+2] if b*(a