#include <bits/stdc++.h>
using namespace std;
const int maxn = 2333333;
vector<int> l[maxn], r[maxn];
int tr[maxn][2], trs;
void dfs(int u, int v) {
  int w = u;
  for (int i = 0; i < (int)l[u].size(); ++i) {
    int j = l[u][i];
    if (j <= trs) throw -1;
    w = max(w, j);
  }
  if (w > u) {
    tr[u][0] = ++trs;
    dfs(trs, w);
  }
  w = u;
  for (int i = 0; i < (int)r[u].size(); ++i) {
    int j = r[u][i];
    if (j <= trs) throw -1;
    w = max(w, j);
  }
  w = max(w, v);
  if (w > trs) {
    tr[u][1] = ++trs;
    dfs(trs, w);
  }
  return;
}
void Print(int u) {
  if (tr[u][0] != 0) Print(tr[u][0]);
  printf("%d ", u);
  if (tr[u][1] != 0) Print(tr[u][1]);
  return;
}
int main() {
  int n, m;
  try {
    scanf("%d%d", &n, &m);
    for (int i = 1; i <= m; ++i) {
      int a, b;
      static char buf[111];
      scanf("%d%d%s", &a, &b, buf);
      if (b <= a) {
        throw -1;
      }
      if (buf[0] == 'L')
        l[a].push_back(b);
      else
        r[a].push_back(b);
    }
    trs = 1;
    dfs(1, n);
    Print(1);
    printf("\n");
  } catch (int exception) {
    printf("IMPOSSIBLE\n");
  }
  return 0;
}
