#include using namespace std; int main() { ios_base::sync_with_stdio(false); int t; string x, y; cin >> t; while(t--) { cin >> x >> y; bool ans = 0; for(int i = 0; i < 8; ++i) { for(int j = 0; j < 3; ++j) { if (i & (1<