package main import . "fmt" func main() { var t int Scan(&t) for ;t>0;t-- { var a1,w1,t1,m1,o1,r1 int var a2,w2,t2,m2,o2,r2 int var x string Scan(&a1,&w1,&t1,&m1,&o1,&r1) Scan(&a2,&w2,&t2,&m2,&o2,&r2) Scan(&x) s1:=w1+t1+m1+o1+r1 s2:=w2+t2+m2+o2+r2 ok:=false switch x { case "WA": ok=w1==0&&w2==s2&&s2>=s1 case "TLE": ok=t1==0&&t2==s2&&s2>=s1 case "MLE": ok=m1==0&&m2==s2&&s2>=s1 case "OLE": ok=o1==0&&o2==s2&&s2>=s1 case "RE": ok=r1==0&&r2==s2&&s2>=s1 } if ok { Println("Yes") } else { Println("No") } } }