#include <bits/stdc++.h>
using namespace std;
const int N = 1234567;
int a[N], b[N], dir[N];
int k;
vector<int> ret;
void solve(int root, int to) {
  if (root > to) {
    return;
  }
  if (root == to) {
    ret.push_back(root);
    return;
  }
  for (int split = root; split <= to; split++) {
    bool ok = true;
    for (int i = 0; i < k; i++) {
      if (root < a[i] && b[i] <= to) {
        if (a[i] <= split && split < b[i]) {
          ok = false;
          break;
        }
      }
      if (root == a[i]) {
        if (dir[i] == 0 && split < b[i]) {
          ok = false;
          break;
        }
        if (dir[i] == 1 && split >= b[i]) {
          ok = false;
          break;
        }
      }
    }
    if (ok) {
      solve(root + 1, split);
      ret.push_back(root);
      solve(split + 1, to);
      return;
    }
  }
  puts("IMPOSSIBLE");
  exit(0);
}
int main() {
  int n;
  scanf("%d %d", &n, &k);
  char foo[42];
  for (int i = 0; i < k; i++) {
    scanf("%d %d %s", a + i, b + i, foo);
    if (a[i] < 1 || a[i] > n || b[i] < 1 || b[i] > n || b[i] <= a[i]) {
      puts("IMPOSSIBLE");
      return 0;
    }
    dir[i] = (foo[0] == 'L' ? 0 : 1);
  }
  ret.clear();
  solve(1, n);
  for (int i = 0; i < n - 1; i++) {
    printf("%d ", ret[i]);
  }
  printf("%d\n", ret[n - 1]);
  return 0;
}
