#pragma region header #include #include using namespace std; using namespace atcoder; // clang-format off struct Fast {Fast() {std::cin.tie(0); ios::sync_with_stdio(false);}} fast; inline void IN(void) { return; } template void IN(First &first, Rest &...rest) { cin >> first; IN(rest...); return; } template istream &operator>>(istream &is, pair &p) { is >> p.first >> p.second; return is; } template istream &operator>>(istream &is, vector &v) { for (auto &x : v) is >> x; return is; } template ostream &operator<<(ostream &os, vector &v) { for (auto &x : v) os << x << " "; os << endl; return os; } // templetes //alias using ull = unsigned long long; using ll = long long; using vi = vector; using vvi = vector; using vll = vector; using vvll = vector; using vb = vector; using vvb = vector; using vs = vector; using pll = pair; //define short #define vec vector #define all(obs) (obs).begin(), (obs).end() #define YESNO(cond) (cond) ? cout << "YES" << endl : cout << "NO" << endl; #define YesNo(cond) (cond) ? cout << "Yes" << endl : cout << "No" << endl; #define yesno(cond) (cond) ? cout << "yes" << endl : cout << "no" << endl; #define sortv(obs) sort(all(obs)) #define rsortv(obs) reverse(sort(all(obs))) #define bitu(n,i) (((n)>>(i))&1) #define dig10(n) to_string(n).size() #define bcnt(n) __builtin_popcount(n) #define bcntll(n) __builtin_popcountll(n) #define F first #define S second #define pb push_back #define pq priority_queue //define loop #define rep(i, a,b) for(ll i = a; i < (b); i++) #define rrep(i, a,b) for(ll i = a; i >= (b); i--) //define INF const ll INF = 1e18; template inline void chmin(T1 &a,T2 b){ if(a>b) a = b; } template inline void chmax(T1 &a,T2 b){ if(a>T; map mp; mp['R']=0; mp['U']=1; mp['L']=2; mp['D']=3; vll dx = {1,0,-1,0}; vll dy = {0,1,0,-1}; rep(i,0,T){ ll x1,y1; ll x2,y2; char d1,d2; cin>>x1>>y1>>d1; cin>>x2>>y2>>d2; if(d1==d2){ cout<<"No"<abs(nx1-nx2)){ cout<<"Yes"<=abs(ny1-ny2)){ cout<<"Yes"<0 && (ty-y2)*dir2>0){ cout<<"Yes"<0 && (ty-y1)*dir1>0){ cout<<"Yes"<