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 V(): global a for k in R(6):B[k]=A[k%3]if k%3!=j else y for i in S: for k in S:x[k]=B[i+2]-B[k+2] x[3]=B[i]+B[i+1]-B[i+2] s,b,c=x[0]+x[1]+x[2]+x[3],1,0 for k in R(4):b,c=b*(x[k]>=0),c+x[k]*X[k] for k in S:b*=s-x[k]<=B[k+2] if b*(a=0),c+x[k]*X[k] for k in S:b*=s-x[k]<=B[k+2] if b*(a