#include using namespace std; void solve() { string s1; string s2; cin >> s1 >> s2; bool OK = false; for(int mask = 0; !OK && mask < (1 << 3); ++mask) { string a; for(int i = 0; i < 3; ++i) if(mask & (1 << i)) a += s1[i]; else a += s2[i]; if(a == "bob" || a == "obb" || a == "bbo") OK = true; } if(OK) cout << "yes\n"; else cout << "no\n"; } int main() { ios_base :: sync_with_stdio(false); cin.tie(NULL); int t; cin >> t; while(t --> 0) solve(); return 0; }