#include <bits/stdc++.h>
const int MAX_N = (int)1e6 + 123;
const double eps = 1e-6;
const int inf = (int)1e9 + 123;
using namespace std;
vector<int> g[MAX_N];
vector<int> l[MAX_N], r[MAX_N];
int n, m;
int u, v;
string second;
void out() {
  cout << "IMPOSSIBLE";
  exit(0);
}
int solve(int v, int con) {
  if (l[v].empty() && r[v].empty()) {
    if (v == con) return v;
    g[v].push_back(v + 1);
    return solve(v + 1, con);
  }
  if (r[v].empty()) swap(l[v], r[v]);
  if (l[v].empty()) {
    for (auto i : r[v]) {
      if (i <= v) out();
      con = max(con, i);
    }
    g[v].push_back(v + 1);
    return solve(v + 1, con);
  }
  int maxi = -1;
  for (auto i : l[v]) {
    if (i <= v) out();
    maxi = max(maxi, i);
  }
  g[v].push_back(v + 1);
  maxi = solve(v + 1, maxi);
  for (auto i : r[v]) {
    if (i <= maxi) out();
    con = max(con, i);
  }
  g[v].push_back(maxi + 1);
  solve(maxi + 1, con);
}
void dfs(int v) {
  if (int((g[v]).size()) > 0) dfs(g[v][0]);
  cout << v << ' ';
  if (int((g[v]).size()) > 1) dfs(g[v][1]);
}
int main() {
  ios_base ::sync_with_stdio(NULL), cin.tie(NULL);
  cin >> n >> m;
  for (int i = 1; i <= m; i++) {
    cin >> u >> v >> second;
    if (second == "LEFT")
      l[u].push_back(v);
    else
      r[u].push_back(v);
  }
  if (solve(1, n) > n) {
    assert(0);
    out();
  }
  dfs(1);
  return 0;
}
