func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, K;   int CtoI(int x) {     if (x ==  R ) return 1;     if (x ==  Y ) return 2;     if (x ==  B ) return 3;     if (x ==  W ) return 0;   }   int ItoC(int x) {     if (x == 1) return  R ;     if (x == 2) return  Y ;     if (x == 3) return  B ;     if (x == 0) return  . ;   }   int ar[2005], mt[2005][2][2];   bitset<2005> a[2005];   void ins(bitset<2005>& x) {     for (int i = 0; i < 2 * n; i++)       if (x[i]) {         if (!a[i].none())           x = x ^ a[i];         else {           a[i] = x;           return;         }       }     if (x[2 * n]) {       puts( NO );       exit(0);     }   }   int main() {     scanf( %d%d , &n, &K);     for (int i = (0), LIM = (n - 1); i <= LIM; i++) mt[i][0][0] = mt[i][1][1] = 1;     for (int i = (0), LIM = (K - 1); i <= LIM; i++) {       int m, x, cl;       char ch[10], col[2];       scanf( %s , ch);       scanf( %d , &m);       for (int j = (1), LIM = (m); j <= LIM; j++) scanf( %d , &ar[j]), ar[j]--;       if (ch[0] ==  m ) {         scanf( %s , col);         cl = CtoI(col[0]);         bitset<2005> A, B;         for (int j = (1), LIM = (m); j <= LIM; j++) {           if (mt[ar[j]][0][0]) A[ar[j] << 1] = A[ar[j] << 1] ^ 1;           if (mt[ar[j]][0][1]) B[ar[j] << 1] = B[ar[j] << 1] ^ 1;           if (mt[ar[j]][1][0]) A[ar[j] << 1 | 1] = A[ar[j] << 1 | 1] ^ 1;           if (mt[ar[j]][1][1]) B[ar[j] << 1 | 1] = B[ar[j] << 1 | 1] ^ 1;         }         A[n << 1] = cl & 1;         B[n << 1] = cl & 2;         ins(A), ins(B);       } else {         int b[2][2] = {};         if (ch[0] ==  R  && ch[1] ==  Y ) {           b[1][0] = b[0][1] = 1;         }         if (ch[0] ==  R  && ch[1] ==  B ) {           b[0][0] = b[1][1] = b[0][1] = 1;         }         if (ch[0] ==  Y ) {           b[0][0] = b[1][1] = b[1][0] = 1;         }         for (int j = (1), LIM = (m); j <= LIM; j++) {           static int c[2][2];           memset(c, 0, sizeof c);           int v = ar[j];           for (int i = (0), LIM = (1); i <= LIM; i++)             for (int j = (0), LIM = (1); j <= LIM; j++)               for (int k = (0), LIM = (1); k <= LIM; k++)                 c[i][k] ^= mt[v][i][j] * b[j][k];           for (int i = (0), LIM = (1); i <= LIM; i++)             for (int j = (0), LIM = (1); j <= LIM; j++) mt[v][i][j] = c[i][j];         }       }     }     for (int i = (2 * n - 1), LIM = (0); i >= LIM; i--) {       for (int j = (i + 1), LIM = (2 * n - 1); j <= LIM; j++)         if (a[i][j]) a[i][n << 1] = a[i][n << 1] ^ a[j][n << 1];     }     puts( YES );     for (int i = (0), LIM = (n - 1); i <= LIM; i++) {       int cl = a[i << 1][n << 1] | (a[i << 1 | 1][n << 1] << 1);       putchar(ItoC(cl));     }   }   