#include <bits/stdc++.h>
using namespace std;
struct Data {
  int parent, child, dir;
};
Data cons[50];
int n, c;
void bad() {
  cout << "IMPOSSIBLE" << endl;
  exit(0);
}
vector<int> dfs(int root, int left, int right) {
  int dir[200];
  memset(dir, 0, sizeof(dir));
  bool flag = true;
  while (flag) {
    flag = false;
    for (int i = 0; i < c; i++) {
      if (cons[i].parent == root) {
        if (cons[i].child < left || cons[i].child > right) {
          bad();
        }
        if (dir[cons[i].child] == 0 || dir[cons[i].child] == cons[i].dir) {
          if (dir[cons[i].child] == 0) {
            if (cons[i].dir == 1) {
              for (int k = cons[i].child; k >= left + 1; k--) {
                if (dir[k] == 1)
                  break;
                else if (dir[k] == 2)
                  bad();
                dir[k] = 1;
              }
            } else {
              for (int k = cons[i].child; k <= right; k++) {
                if (dir[k] == 2)
                  break;
                else if (dir[k] == 1)
                  bad();
                dir[k] = 2;
              }
            }
            flag = true;
          }
        } else {
          bad();
        }
        continue;
      }
      if (cons[i].parent < left || cons[i].parent > right) {
        continue;
      }
      if (cons[i].child < left || cons[i].child > right) {
        bad();
      }
      if (dir[cons[i].child] && dir[cons[i].parent]) {
        if (dir[cons[i].child] != dir[cons[i].parent]) {
          bad();
        }
      } else if (dir[cons[i].child]) {
        if (dir[cons[i].child] == 1) {
          for (int k = cons[i].parent; k >= left + 1; k--) {
            if (dir[k] == 1)
              break;
            else if (dir[k] == 2)
              bad();
            dir[k] = 1;
          }
        } else {
          for (int k = cons[i].parent; k <= right; k++) {
            if (dir[k] == 2)
              break;
            else if (dir[k] == 1)
              bad();
            dir[k] = 2;
          }
        }
        flag = true;
      } else if (dir[cons[i].parent]) {
        if (dir[cons[i].parent] == 1) {
          for (int k = cons[i].child; k >= left + 1; k--) {
            if (dir[k] == 1)
              break;
            else if (dir[k] == 2)
              bad();
            dir[k] = 1;
          }
        } else {
          for (int k = cons[i].child; k <= right; k++) {
            if (dir[k] == 2)
              break;
            else if (dir[k] == 1)
              bad();
            dir[k] = 2;
          }
        }
        flag = true;
      }
    }
  }
  int lmin, lmax;
  lmin = lmax = -1;
  for (int i = left + 1; i <= right; i++) {
    if (dir[i] == 1 || dir[i] == 0) {
      lmax = i;
      if (lmin == -1) {
        lmin = left + 1;
      }
    }
  }
  int rmax, rmin;
  rmax = rmin = -1;
  for (int i = right; i >= left + 1; i--) {
    if (dir[i] == 2) {
      rmin = i;
      if (rmax == -1) {
        rmax = right;
      }
    }
  }
  vector<int> leftpart, rightpart;
  if (lmin != -1) {
    leftpart = dfs(lmin, lmin, lmax);
  }
  if (rmax != -1) {
    rightpart = dfs(rmin, rmin, rmax);
  }
  leftpart.push_back(root);
  for (auto x : rightpart) {
    leftpart.push_back(x);
  }
  return leftpart;
}
int main() {
  cin >> n >> c;
  for (int i = 0; i < c; i++) {
    int p, child;
    string dir;
    cin >> p >> child >> dir;
    if (child <= p) {
      bad();
    }
    cons[i].parent = p;
    cons[i].child = child;
    if (dir == "LEFT") {
      cons[i].dir = 1;
    } else {
      cons[i].dir = 2;
    }
  }
  auto res = dfs(1, 1, n);
  for (auto x : res) {
    cout << x << " ";
  }
}
