T=int(input()) di="LDRU"*2 for i in range(T): x1,y1,d1=input().split() x2,y2,d2=input().split() x1=int(x1) y1=int(y1) x2=int(x2) y2=int(y2) ans="No" for j in range(4): x1,y1=-y1,x1 x2,y2=-y2,x2 d1=di[di.find(d1)+1] d2=di[di.find(d2)+1] if y1==y2 and x1