#include <bits/stdc++.h>
using namespace std;
const int INF = 1E9;
int N, C;
vector<int> L[1000010], R[1000010];
char buf[110];
vector<int> out;
int build(int lo, int mlo, int mhi) {
  if (mlo > mhi) return INF;
  if (lo > mlo) return lo - 1;
  if (!L[lo].empty()) {
    (mlo) = max((mlo), (*max_element(L[lo].begin(), L[lo].end())));
    if (*min_element(L[lo].begin(), L[lo].end()) <= lo) return INF;
  }
  if (!R[lo].empty()) {
    (mlo) = max((mlo), (*max_element(R[lo].begin(), R[lo].end())));
    if (*min_element(R[lo].begin(), R[lo].end()) <= lo) return INF;
  }
  if (((int)(L[lo]).size()) == 0) {
    out.push_back(lo);
    int tmp = build(lo + 1, mlo, mhi);
    return tmp;
  }
  if (((int)(R[lo]).size()) == 0) {
    int tmp = build(lo + 1, mlo, mhi);
    out.push_back(lo);
    return tmp;
  }
  int lm = *max_element(L[lo].begin(), L[lo].end());
  int rm = *min_element(R[lo].begin(), R[lo].end());
  if (lm >= rm) return INF;
  int rmax = *max_element(R[lo].begin(), R[lo].end());
  int mid = build(lo + 1, lm, rm - 1);
  out.push_back(lo);
  mid = build(mid + 1, max(mlo, rmax), mhi);
  return (mid <= mhi) ? mid : INF;
}
int main() {
  scanf("%d%d", &N, &C);
  for (int i = 0; i < C; ++i) {
    int a, b;
    scanf("%d%d%s", &a, &b, &buf);
    --a, --b;
    if (buf[0] == 'L')
      L[a].push_back(b);
    else
      R[a].push_back(b);
  }
  int s = build(0, N - 1, N - 1);
  if (s == INF)
    puts("IMPOSSIBLE");
  else {
    for (int i = 0; i < ((int)(out).size()); ++i)
      printf("%d%c", out[i] + 1, (i + 1 == ((int)(out).size())) ? '\n' : ' ');
  }
  return 0;
}
