#include using namespace std; int main(){ int N; cin >> N; for (int i = 0; i < N; i++){ vector c1(6); for (int j = 0; j < 6; j++){ cin >> c1[j]; } vector c2(6); for (int j = 0; j < 6; j++){ cin >> c2[j]; } string X; cin >> X; int cnt1 = c1[1] + c1[2] + c1[3] + c1[4] + c1[5]; int cnt2 = c2[i] + c2[2] + c2[3] + c2[4] + c2[5]; bool ans = true; if (X == "WA" && c2[1] != cnt2){ ans = false; } if (X == "TLE" && c2[2] != cnt2){ ans = false; } if (X == "MLE" && c2[3] != cnt2){ ans = false; } if (X == "OLE" && c2[4] != cnt2){ ans = false; } if (X == "RE" && c2[4] != cnt2){ ans = false; } if (ans){ cout << "Yes" << endl; } else { cout << "No" << endl; } } }