#include <bits/stdc++.h>
using namespace std;
const int N = (int)1e6 + 5;
int n, c;
vector<pair<int, int>> go[N];
int edge[N][2];
void fail() {
  puts("IMPOSSIBLE");
  exit(0);
}
int dfs(int L, int R, int need_R) {
  int min_l = n, max_l = -1;
  int min_r = n, max_r = -1;
  for (auto e : go[L]) {
    if (e.second == 0) {
      min_l = min(min_l, e.first);
      max_l = max(max_l, e.first);
    } else {
      min_r = min(min_r, e.first);
      max_r = max(max_r, e.first);
    }
  }
  if (max_l >= min_r) fail();
  if (min_l <= L) fail();
  if (min_r <= L) fail();
  if (max_l > R) fail();
  if (max_r > R) fail();
  if (min_l != n && min_r != n) {
    edge[L][0] = L + 1;
    int rightmost = dfs(L + 1, min_r - 1, max_l);
    edge[L][1] = rightmost + 1;
    int new_rightmost = dfs(rightmost + 1, R, max(need_R, max_r));
    return new_rightmost;
  }
  if (min_r != n) {
    edge[L][1] = L + 1;
    return dfs(L + 1, R, max(need_R, max_r));
  }
  if (min_l != n) {
    edge[L][0] = L + 1;
    return dfs(L + 1, R, max(need_R, max_l));
  }
  if (L < R) {
    if (L + 1 <= need_R) {
      edge[L][0] = L + 1;
      return dfs(L + 1, R, need_R);
    }
    return need_R;
  }
  return L;
}
void traverse(int v) {
  if (v == -1) return;
  traverse(edge[v][0]);
  printf("%d ", v + 1);
  traverse(edge[v][1]);
}
void solve() {
  memset(edge, -1, sizeof(edge));
  scanf("%d%d", &n, &c);
  for (int i = 0; i < c; i++) {
    int a, b;
    char buf[10];
    scanf("%d%d%s", &a, &b, buf);
    a--;
    b--;
    go[a].push_back(make_pair(b, (buf[0] == 'L' ? 0 : 1)));
  }
  dfs(0, n - 1, n - 1);
  traverse(0);
}
int main() {
  solve();
  0;
  return 0;
}
