#include #include #include #include #include #include #include #include #include using namespace std; int main() { ios_base::sync_with_stdio(false), cin.tie(nullptr), cout.tie(nullptr); int t; cin >> t; while (t--) { string s; cin >> s; int n=s.length(); int f=0; if (n>3) { for (int i=0; i> q; while (q--) { int y, x; cin >> y >> x; y--; if (n<4) cout << "NO" << endl; else if (n<10) { int no=1; for (int i=0; i0 && y1 && y2) f--; s[y]=x+'0'; if (s.substr(y,4)=="1100" && y0 && y1 && y2) f++; if (f) cout << "YES" << endl; else cout << "NO" << endl; } } } return 0; } /* */