#include <bits/stdc++.h>
using namespace std;
const int Maxn = 1000200;
int Lmax[Maxn], Rmin[Maxn], Rmax[Maxn];
vector<int> rep;
bool flag = 1;
int dfs_t = 2;
void dfs(int l, int r) {
  if (!flag) return;
  if (Lmax[l]) dfs(dfs_t++, Lmax[l]);
  rep.push_back(l);
  if (dfs_t > Rmin[l]) {
    flag = false;
    return;
  }
  r = max(r, Rmax[l]);
  if (dfs_t <= r) dfs(dfs_t++, r);
}
int main() {
  int n, m;
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= n; i++) Lmax[i] = Rmax[i] = 0, Rmin[i] = n + 1;
  while (m--) {
    int a, b;
    char s[10];
    scanf("%d%d%s", &a, &b, s);
    if (a >= b) flag = false;
    if (s[0] == 'L')
      Lmax[a] = max(Lmax[a], b);
    else
      Rmax[a] = max(Rmax[a], b), Rmin[a] = min(Rmin[a], b);
  }
  dfs(1, n);
  if (!flag)
    puts("IMPOSSIBLE");
  else {
    for (int i = 0; i < n; i++) printf("%d%c", rep[i], i == n - 1 ? '\n' : ' ');
  }
}
