#include #include using namespace std; #define rep(i,n) for (int i = 0; i < (n); ++i) #define Inf 1000000000 int main(){ int N; cin>>N; map mp; mp["WA"] = 1; mp["TLE"] = 2; mp["MLE"] = 3; mp["OLE"] = 4; mp["RE"] = 5; rep(_,N){ vector x(6),y(6); rep(i,6)cin>>x[i]; rep(i,6)cin>>y[i]; string s; cin>>s; int ind = mp[s]; if(x[ind]!=0){ cout<<"No"<