func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, c;   int a[1 << 20], b[1 << 20];   char tp[1 << 20];   int hs[128][128];   int ne[128][128];   int li[128];   bool getDP(int l, int r) {     if (hs[l][r] != -1) return hs[l][r];     if (l >= r) {       return (hs[l][r] = 1);     }     hs[l][r] = 0;     for (int k = l; k <= r; ++k) {       bool ok = true;       for (int i = 0; i < c; ++i) {         if (a[i] == l) {           if (tp[i] ==  L  && b[i] > k) ok = false;           if (tp[i] ==  R  && b[i] <= k) ok = false;         }         if (a[i] > l && a[i] <= k) {           if (b[i] > k) ok = false;         }       }       if (ok) {         if (getDP(l + 1, k) && getDP(k + 1, r)) {           ne[l][r] = k;           hs[l][r] = 1;           break;         }       }     }     return hs[l][r];   }   int le[1 << 20], ri[1 << 20];   void cli(int l, int r) {     if (l >= r) return;     li[l] = ne[l][r];     if (li[l] > l) {       le[l] = l + 1;       cli(l + 1, li[l]);     }     if (li[l] < r) {       ri[l] = li[l] + 1;       cli(li[l] + 1, r);     }   }   vector<int> sl;   void sol(int v) {     if (le[v] != -1) sol(le[v]);     sl.push_back(v);     if (ri[v] != -1) sol(ri[v]);   }   int main() {     scanf( %d %d , &n, &c);     char buf[32];     for (int i = 0; i < c; i++) {       scanf( %d %d %s , &a[i], &b[i], buf);       tp[i] = buf[0];       if (a[i] >= b[i]) {         printf( IMPOSSIBLE n );         return 0;       }     }     memset(hs, -1, sizeof(hs));     bool ok = getDP(1, n);     if (!ok) {       printf( IMPOSSIBLE n );       return 0;     }     memset(li, -1, sizeof(li));     memset(le, -1, sizeof(le));     memset(ri, -1, sizeof(ri));     cli(1, n);     sol(1);     for (int i = 0; i + 1 < (int)sl.size(); i++) {       printf( %d  , sl[i]);     }     printf( %d n , sl.back());     return 0;   }   