Q=int(input()) for q in range(Q): X,Y,dX,dY=[],[],[],[] for _ in range(2): x,y,d=input().split() x=int(x)*2 y=int(y)*2 X.append(x) Y.append(y) if d=="R": dx,dy=1,0 elif d=="L": dx,dy=-1,0 elif d=="U": dx,dy=0,1 elif d=="D": dx,dy=0,-1 dX.append(dx) dY.append(dy) ans="No" T=[] x=abs(X[0]-X[1]) T.append(x) T.append(x//2) y=abs(Y[0]-Y[1]) T.append(y) T.append(y//2) for t in T: if (X[0]+dX[0]*t,Y[0]+dY[0]*t)==(X[1]+dX[1]*t,Y[1]+dY[1]*t): ans="Yes" print(ans)