#include #include #include #include #include #include #include #include #include using namespace std; void solve(){ vector res = {"AC", "WA", "TLE", "MLE", "OLE", "RE"}; vector a(6), b(6); string s; int cnt = 0; for(int j = 0; j < 6; j++){ cin >> a[j]; cnt += a[j]; } for(int j = 0; j < 6; j++) cin >> b[j]; cin >> s; for(int j = 0; j < 6; j++){ if (s == res[j]){ if (j != 0 && a[j] != 0) cout << "No" << endl; else { if (j == 0) cout << ((b[0] == cnt) ? "Yes" : "No" ) << endl; else cout << ((cnt - b[0] == b[j]) ? "Yes" : "No" ) << endl; } } } } int main() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(15); int n; cin >> n; for (int i = 0; i < n; i++) solve(); }