#include <bits/stdc++.h>
using namespace std;
const int INF = (int)2e9;
const long long INFL = (long long)9e18;
const int MAXINT = ((~0) ^ (1 << 31));
const long long MAXLL = ((~0) ^ ((long long)1 << 63));
template <class T>
inline T pow2(T a) {
  return a * a;
}
template <class T>
inline bool mineq(T& a, T b) {
  return (a > b) ? (a = b, true) : false;
}
template <class T>
inline bool maxeq(T& a, T b) {
  return (a < b) ? (a = b, true) : false;
}
const int maxn = (int)1e6 + 10;
;
int n, c, pr[maxn], used[maxn], isl[maxn];
pair<int, int> skjhfkjds[maxn], safadss[maxn];
void Done() {
  cout << "IMPOSSIBLE";
  exit(0);
}
int dfs(int v, int par, int lim) {
  pr[v] = par;
  if (safadss[v].first == INF && skjhfkjds[v].first == INF && lim == v)
    return v;
  if (safadss[v].first <= skjhfkjds[v].second) {
    Done();
  }
  int ret = -2;
  if (skjhfkjds[v].first != INF) {
    if (safadss[v].first != INF) {
      ret = dfs(v + 1, v, skjhfkjds[v].second);
      isl[v + 1] = true;
      if (ret >= safadss[v].first) {
        Done();
      }
      ret = dfs(ret + 1, v, max(safadss[v].second, lim));
      return ret;
    } else {
      return dfs(v + 1, v, max(skjhfkjds[v].second, lim));
      isl[v + 1] = true;
    }
  } else {
    if (safadss[v].first != INF) {
      return dfs(v + 1, v, max(safadss[v].second, lim));
    } else {
      return dfs(v + 1, v, lim);
    }
  }
}
vector<int> adj[maxn];
void print(int v) {
  sort(adj[v].begin(), adj[v].end());
  if (!adj[v].empty() && isl[adj[v][0]]) {
    print(adj[v][0]);
  }
  cout << v << " ";
  if (adj[v].size() > 1) print(adj[v][1]);
  if (adj[v].size() == 1 && !isl[adj[v][0]]) print(adj[v][0]);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  for (int i = 0; i < (int)(maxn); i++) {
    pr[i] = -1;
    skjhfkjds[i].first = INF;
    safadss[i].first = INF;
  }
  cin >> n >> c;
  for (int i = 0; i < (int)(c); i++) {
    int a, b;
    string str;
    cin >> a >> b >> str;
    used[b] = true;
    if (str == "LEFT") {
      mineq(skjhfkjds[a].first, b);
      maxeq(skjhfkjds[a].second, b);
    } else {
      mineq(safadss[a].first, b);
      maxeq(safadss[a].second, b);
    }
  }
  for (int i = 1; i < (int)(n + 1); i++) {
    if (skjhfkjds[i].first <= i || safadss[i].first <= i) Done();
  }
  int start = 1;
  if (used[start]) Done();
  dfs(start, -1, n);
  for (int i = 1; i < (int)(n + 1); i++)
    if (pr[i] != -1) adj[pr[i]].push_back(i);
  print(start);
}
