#include <bits/stdc++.h>
using namespace std;
const int N = 1000008, C = 100008;
int n, c, L[N], R[N], LL[N], RR[N], a[C], b[C], ty[C], lmx[N], rmx[N];
int cur, cnt;
void fail() {
  printf("IMPOSSIBLE\n");
  exit(0);
}
void dfs(int u, int Max) {
  if (cur >= n) return;
  if (lmx[u]) {
    L[u] = ++cur;
    dfs(u + 1, lmx[u]);
    if (rmx[u] || cur < Max) {
      R[u] = ++cur;
      dfs(cur, max(Max, rmx[u]));
    }
  } else if (rmx[u] || cur < Max) {
    R[u] = ++cur;
    dfs(cur, max(Max, rmx[u]));
  }
}
void check_ord(int u) {
  if (!u || u > n) return;
  ++cnt;
  if (u != cnt) fail();
  check_ord(L[u]);
  check_ord(R[u]);
}
void dfs_ord(int u) {
  if (!u || u > n) return;
  cnt++;
  LL[u] = cnt;
  dfs_ord(L[u]);
  dfs_ord(R[u]);
  RR[u] = cnt;
}
void write(int u) {
  if (!u || u > n) return;
  write(L[u]);
  printf("%d ", u);
  write(R[u]);
}
int main() {
  scanf("%d%d", &n, &c);
  for (int i = 1; i <= c; i++) {
    char ch[6];
    scanf("%d%d%s", &a[i], &b[i], ch);
    if (ch[0] == 'L')
      lmx[a[i]] = max(lmx[a[i]], b[i]), ty[i] = 0;
    else
      rmx[a[i]] = max(rmx[a[i]], b[i]), ty[i] = 1;
    if (a[i] >= b[i]) fail();
  }
  dfs(cur = 1, n);
  check_ord(1);
  cnt = 0;
  dfs_ord(1);
  for (int i = 1; i <= c; i++) {
    int u = a[i], v;
    if (ty[i] == 0)
      v = L[u];
    else
      v = R[u];
    if (!v || v > n) fail();
    if (LL[v] > LL[b[i]] || RR[v] < RR[b[i]]) fail();
  }
  write(1);
  return 0;
}
