#include #include #include using namespace std; using ll = long long; int main(){ cin.tie(nullptr); ios::sync_with_stdio(false); int t; cin>>t; while(t--){ ll a,b,c,d; char x,y; cin>>a>>b>>x>>c>>d>>y; if((x=='R'||x=='L')&&(y=='R'||y=='L')){ if(b!=d) cout<<"No\n"; else if(ab) n1 = d - b; else if(x=='D'&&b>d) n1 = b - d; if(y=='R'&&c