#include <bits/stdc++.h>
using namespace std;
const int N = 100005;
const int M = 1000005;
int A[N], B[N], l[M], r[M], ll[M], rr[M], lll[M], rrr[M];
char str[N][10];
int clk, now;
bool ok;
void dfs(int l, int r) {
  if (l >= r) return;
  if (!lll[l]) {
    rr[l] = l + 1;
    dfs(l + 1, r);
    return;
  }
  ll[l] = l + 1;
  if (l != r && lll[l] < r) rr[l] = lll[l] + 1;
  dfs(l + 1, lll[l]);
  dfs(lll[l] + 1, r);
}
void previsit(int x) {
  l[x] = ++clk;
  if (ll[x]) previsit(ll[x]);
  if (rr[x]) previsit(rr[x]);
  r[x] = clk;
}
void output(int x) {
  if (ll[x]) output(ll[x]);
  printf("%d ", x);
  if (rr[x]) output(rr[x]);
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; ++i) {
    scanf("%d%d", &A[i], &B[i]);
    scanf("%s", str[i]);
    if (str[i][0] == 'L')
      lll[A[i]] = max(lll[A[i]], B[i]);
    else
      rrr[A[i]] = max(rrr[A[i]], B[i]);
  }
  for (int i = 1; i <= n; ++i) {
    now = lll[i];
    ok = 1;
    while (ok) {
      ok = 0;
      for (int j = i + 1; j <= now; ++j)
        if (max(lll[j], rrr[j]) > now) {
          now = max(lll[j], rrr[j]);
          ok = 1;
        }
    }
    lll[i] = now;
  }
  for (int i = 1; i <= n; ++i)
    if (lll[i] && lll[i] <= i) {
      puts("IMPOSSIBLE");
      return 0;
    }
  dfs(1, n);
  clk = 0;
  previsit(1);
  for (int i = 1; i <= m; ++i) {
    if ((str[i][0] == 'L' &&
         (l[ll[A[i]]] > l[B[i]] || r[ll[A[i]]] < l[B[i]])) ||
        (str[i][0] == 'R' &&
         (l[rr[A[i]]] > l[B[i]] || r[rr[A[i]]] < l[B[i]]))) {
      puts("IMPOSSIBLE");
      return 0;
    }
  }
  output(1);
  return 0;
}
