func_code_string: #include <bits/stdc++.h>   using namespace std;   struct chess {     bool used;     int x, y;     char p;   } up, down, Left, Right, up_Left, up_Right, down_Left, down_Right;   int n, kx, ky;   void add(int x, int y, char c) {     if (x == kx) {       if (y < ky) {         if (!Left.used || y > Left.y) {           Left.x = x;           Left.y = y;           Left.p = c;           Left.used = true;         }       } else {         if (!Right.used || y < Right.y) {           Right.x = x;           Right.y = y;           Right.p = c;           Right.used = true;         }       }     }     if (y == ky) {       if (x < kx) {         if (!up.used || x > up.x) {           up.x = x;           up.y = y;           up.p = c;           up.used = true;         }       } else {         if (!down.used || x < down.x) {           down.x = x;           down.y = y;           down.p = c;           down.used = true;         }       }     }     if (x - y == kx - ky) {       if (x < kx) {         if (!up_Left.used || x > up_Left.x) {           up_Left.x = x;           up_Left.y = y;           up_Left.p = c;           up_Left.used = true;         }       } else {         if (!down_Right.used || x < down_Right.x) {           down_Right.x = x;           down_Right.y = y;           down_Right.p = c;           down_Right.used = true;         }       }     }     if (x + y == kx + ky) {       if (x < kx) {         if (!up_Right.used || x > up_Right.x) {           up_Right.x = x;           up_Right.y = y;           up_Right.p = c;           up_Right.used = true;         }       } else {         if (!down_Left.used || x < down_Left.x) {           down_Left.x = x;           down_Left.y = y;           down_Left.p = c;           down_Left.used = true;         }       }     }   }   bool check() {     if (up.p ==  R  || up.p ==  Q  || down.p ==  R  || down.p ==  Q ) return true;     if (Left.p ==  R  || Left.p ==  Q  || Right.p ==  R  || Right.p ==  Q )       return true;     if (up_Right.p ==  B  || up_Right.p ==  Q  || up_Left.p ==  B  ||         up_Left.p ==  Q )       return true;     if (down_Right.p ==  B  || down_Right.p ==  Q  || down_Left.p ==  B  ||         down_Left.p ==  Q )       return true;     return false;   }   int main() {     int x, y;     ios::sync_with_stdio(false);     cin.tie(0);     char c;     cin >> n >> kx >> ky;     for (int i = 0; i < n; i++) {       cin >> c >> x >> y;       add(x, y, c);     }     if (check())       cout <<  YES ;     else       cout <<  NO ;     return 0;   }   