#include <bits/stdc++.h>
using namespace std;
const int INF = 1e9 + 7;
const long double EPS = 1e-14;
const int MAXN = 1000007;
int N, C;
int last = -1, l1[MAXN], l2[MAXN], r1[MAXN], r2[MAXN];
vector<int> ans;
char res = true;
void dfs(int x) {
  int i = ++last;
  if (l1[i] != -1) {
    if (l1[i] <= last) {
      res = false;
      return;
    }
    dfs(l2[i]);
    if (!res) return;
  }
  ans.push_back(i);
  if (r1[i] != -1) {
    if (r1[i] <= last) {
      res = false;
      return;
    }
    dfs(max(x, r2[i]));
    if (!res) return;
  } else if (x > last)
    dfs(x);
}
int main() {
  cin >> N >> C;
  for (int i = 0; i < int(MAXN); i++) l1[i] = l2[i] = r1[i] = r2[i] = -1;
  for (int i = 0; i < int(C); i++) {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    string s;
    cin >> s;
    if (s == "LEFT") {
      l1[a] = ((l1[a] >= 0) ? min(l1[a], b) : b);
      l2[a] = max(l2[a], b);
    } else {
      r1[a] = ((r1[a] >= 0) ? min(r1[a], b) : b);
      r2[a] = max(r2[a], b);
    }
  }
  dfs(N - 1);
  if (res)
    for (int i = 0; i < int(ans.size()); i++) cout << ans[i] + 1 << " ";
  else
    printf("IMPOSSIBLE");
}
