#include <bits/stdc++.h>
using namespace std;
const int mN = 1e6 + 100;
int n, mxL[mN], mxR[mN], c, l[mN], r[mN], mnR[mN];
char x[6];
bool ok = 1;
int solve(int cur, int e) {
  if (cur > e) return -1;
  if (mxL[cur] == -1 && mxR[cur] == -1) return cur;
  if (mxL[cur] == -1) {
    int i;
    for (i = cur; i < mxR[cur];) {
      r[i] = i + 1;
      i = solve(i + 1, e);
      if (i == -1) return -1;
    }
    return i;
  }
  int i;
  for (i = cur; i < mxL[cur];) {
    l[i] = i + 1;
    i = solve(i + 1, e);
    if (i == -1) return -1;
  }
  if (mxR[cur] == -1) return i;
  if (i >= mnR[cur]) return -1;
  ++i;
  r[cur] = i;
  i = solve(i, e);
  if (i == -1) return -1;
  for (; i < mxR[cur];) {
    r[i] = i + 1;
    i = solve(i + 1, e);
    if (i == -1) return -1;
  }
  return i;
}
void print(int cur) {
  if (~l[cur]) print(l[cur]);
  printf("%d ", cur + 1);
  if (~r[cur]) print(r[cur]);
}
int main() {
  scanf("%d", &n), scanf("%d", &c);
  memset(mxL, -1, sizeof mxL);
  memset(mxR, -1, sizeof mxR);
  memset(mnR, -1, sizeof mnR);
  for (int i = 0; i < c; ++i) {
    int a, b;
    scanf("%d", &a), scanf("%d", &b);
    --a, --b;
    if (b <= a) return puts("IMPOSSIBLE");
    scanf(" %s", &x);
    if (x[0] == 'L')
      mxL[a] = max(mxL[a], b);
    else {
      mxR[a] = max(mxR[a], b);
      if (mnR[a] == -1)
        mnR[a] = b;
      else
        mnR[a] = min(mnR[a], b);
    }
  }
  memset(l, -1, sizeof l);
  memset(r, -1, sizeof r);
  int i = solve(0, n - 1);
  if (i == -1) return puts("IMPOSSIBLE");
  while (i < n - 1) {
    r[i] = i + 1;
    i = solve(i + 1, n - 1);
    if (i == -1) return puts("IMPOSSIBLE");
  }
  print(0);
}
