#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000000;
const int MAXC = 100000;
int lmn[MAXN], lmx[MAXN], lsz[MAXN];
int rmn[MAXN], rmx[MAXN], rsz[MAXN];
int l[MAXN], r[MAXN];
int dfs(int v, int x) {
  if (lsz[v] == 0) {
    l[v] = -1;
    if (rsz[v] == 0) {
      if (v == x) {
        r[v] = -1;
        return v;
      } else {
        r[v] = v + 1;
        return dfs(v + 1, x);
      }
    } else {
      r[v] = v + 1;
      return dfs(v + 1, max(x, rmx[v]));
    }
  } else {
    l[v] = v + 1;
    int y = dfs(v + 1, lmx[v]);
    if (rsz[v] > 0) {
      if (y >= rmn[v]) {
        cout << "IMPOSSIBLE\n";
        exit(0);
      }
      r[v] = y + 1;
      return dfs(y + 1, max(x, rmx[v]));
    } else {
      if (y + 1 <= x) {
        r[v] = y + 1;
        return dfs(y + 1, x);
      }
      r[v] = -1;
      return y;
    }
  }
}
void in_order(int v) {
  if (l[v] != -1) in_order(l[v]);
  cout << v + 1 << ' ';
  if (r[v] != -1) in_order(r[v]);
}
int main() {
  int n, c;
  cin >> n >> c;
  for (int i = 0; i < n; ++i) {
    lmn[i] = rmn[i] = INT_MAX;
    lmx[i] = rmx[i] = INT_MIN;
    lsz[i] = rsz[i] = 0;
  }
  for (int i = 0; i < c; ++i) {
    int a, b;
    string d;
    cin >> a >> b >> d;
    --a, --b;
    if (d == "LEFT") {
      lsz[a]++;
      lmn[a] = min(lmn[a], b);
      lmx[a] = max(lmx[a], b);
    } else {
      rsz[a]++;
      rmn[a] = min(rmn[a], b);
      rmx[a] = max(rmx[a], b);
    }
  }
  for (int i = 0; i < n; ++i) {
    if (lmx[i] >= rmn[i] || lmn[i] <= i || rmn[i] <= i) {
      cout << "IMPOSSIBLE\n";
      exit(0);
    }
  }
  dfs(0, n - 1);
  in_order(0);
  return 0;
}
