#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
int nptr = 1, sol[1000005][2] = {0}, maxl[1000005], minr[1000005],
    maxr[1000005];
bool lex[1000005], rex[1000005];
int n, c, x, y;
string cmd;
bool buildTree(int cur, int n) {
  if (lex[cur] == true) {
    sol[cur][0] = ++nptr;
    if (buildTree(nptr, maxl[cur]) == false) return false;
  }
  if (rex[cur] == true && nptr >= minr[cur]) return false;
  if (rex[cur] == true) n = max(n, maxr[cur]);
  if (n > nptr) {
    sol[cur][1] = ++nptr;
    if (buildTree(nptr, n) == false) return false;
  }
  return true;
}
void inorder(int cur) {
  if (sol[cur][0] != 0) inorder(sol[cur][0]);
  cout << cur << " ";
  if (sol[cur][1] != 0) inorder(sol[cur][1]);
}
int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  cin >> n >> c;
  for (int i = (0), _b = (n); i <= _b; i++) {
    minr[i] = 1e9;
    lex[i] = rex[i] = false;
  }
  for (int i = (1), _b = (c); i <= _b; i++) {
    cin >> x >> y >> cmd;
    if (x >= y) {
      cout << "IMPOSSIBLE" << endl;
      return 0;
    }
    if (cmd[0] == 'L') {
      lex[x] = true;
      maxl[x] = max(maxl[x], y);
    } else {
      rex[x] = true;
      minr[x] = min(minr[x], y);
      maxr[x] = max(maxr[x], y);
    }
  }
  if (buildTree(1, n))
    inorder(1);
  else
    cout << "IMPOSSIBLE";
  cout << endl;
  return 0;
}
