#include <bits/stdc++.h>
using namespace std;
const int N = 1e6 + 5;
const int M = 1e5 + 5;
int a[M], b[M], t[M];
int n, m;
char s[10];
int label = 1, cnt = 0;
inline void Fail() {
  puts("IMPOSSIBLE");
  exit(0);
}
int L[N], R[N], lmx[N], rmx[N];
void dfs(int u, int mx) {
  if (label >= n) return;
  if (lmx[u]) {
    L[u] = ++label;
    ++cnt;
    dfs(label, lmx[u]);
    --cnt;
    if (rmx[u] || label < mx || cnt == 0) {
      R[u] = ++label;
      dfs(label, max(mx, rmx[u]));
    }
  } else if (rmx[u] || label < mx || cnt == 0) {
    R[u] = ++label;
    dfs(label, max(mx, rmx[u]));
  }
}
void pre_ord(int u) {
  if (!u || u > n) return;
  if (u != cnt) Fail();
  cnt++;
  pre_ord(L[u]);
  pre_ord(R[u]);
}
void in_ord(int u) {
  if (!u || u > n) return;
  in_ord(L[u]);
  printf("%d ", u);
  in_ord(R[u]);
}
int ll[N], rr[N];
void Travel(int u) {
  if (!u || u > n) return;
  ll[u] = ++label;
  Travel(L[u]);
  Travel(R[u]);
  rr[u] = label;
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; ++i) {
    scanf("%d%d%s", a + i, b + i, s);
    t[i] = *s == 'R';
    if (b[i] <= a[i]) Fail();
    if (t[i]) {
      rmx[a[i]] = max(rmx[a[i]], b[i]);
    } else {
      lmx[a[i]] = max(lmx[a[i]], b[i]);
    }
  }
  dfs(1, 0);
  cnt = 1;
  pre_ord(1);
  label = 0;
  Travel(1);
  for (int i = 0; i < m; ++i) {
    int son = t[i] ? R[a[i]] : L[a[i]];
    if (!son || son > n) Fail();
    if (ll[b[i]] < ll[son] || rr[son] < ll[b[i]]) Fail();
  }
  in_ord(1);
  return 0;
}
