#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 5;
const int mod = 1e9 + 7;
int n, m, L[N], R[N], x;
vector<int> l[N], r[N];
void fail() {
  puts("IMPOSSIBLE");
  exit(0);
}
void dfs(int v = 1, int lim = n) {
  sort(l[v].begin(), l[v].end());
  sort(r[v].begin(), r[v].end());
  if (l[v].size()) {
    x++;
    L[v] = x;
    dfs(x, l[v].back());
  }
  if (r[v].size() && x >= r[v].front()) fail();
  if (r[v].size()) lim = max(lim, r[v].back());
  if (lim > x) {
    x++;
    R[v] = x;
    dfs(x, lim);
  }
}
void out(int v = 1) {
  if (!v) return;
  out(L[v]);
  cout << v << " ";
  out(R[v]);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    int a, b;
    cin >> a >> b;
    if (b <= a) fail();
    string type;
    cin >> type;
    if (type[0] == 'L')
      l[a].push_back(b);
    else
      r[a].push_back(b);
  }
  x = 1;
  dfs();
  out();
  return 0;
}
