#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000000 + 10;
const int INF = 1000000000;
const int MOD = (int)(1e9) + 7;
int l[MAXN], r[MAXN], ms[MAXN];
int f[200][200];
vector<int> res;
bool ok;
int n, c;
void ans(int u, int v) {
  if (u > v) return;
  if (!ok) return;
  int x = -1;
  for (int i = u; i <= l[i] - 1; i++) x = max(x, ms[i]);
  int p = -1;
  for (int i = l[u]; i <= r[u]; i++) {
    if (i >= u) x = max(x, ms[i]);
    if (x <= i) {
      p = i;
      break;
    }
  }
  if (p == -1) {
    ok = false;
    return;
  }
  p = max(p, u);
  ans(u + 1, p);
  res.push_back(u);
  ans(p + 1, v);
}
void ans1(int u, int v) {
  if (u > v) return;
  ans1(u + 1, f[u][v]);
  cout << u << " ";
  ans1(f[u][v] + 1, v);
}
void sub1() {
  for (int i = 1; i <= n; i++) f[i + 1][i] = 1;
  for (int i = n; i >= 1; i--) {
    if (ms[i] <= i)
      f[i][i] = i;
    else
      f[i][i] = 0;
    for (int j = max(i + 1, ms[i]); j <= n; j++) {
      for (int k = l[i]; k <= min(j, r[i] - 1); k++) {
        if ((f[i + 1][k] > 0) && (f[k + 1][j] > 0)) {
          f[i][j] = k;
          break;
        }
      }
      int x = 0;
      for (int k = i; k <= j; k++) x = max(x, ms[k]);
      if (x > j) f[i][j] = 0;
    }
  }
  if (f[1][n] == 0) {
    cout << "IMPOSSIBLE" << endl;
    return;
  }
  ans1(1, n);
}
int main() {
  string im = "IMPOSSIBLE";
  cin >> n >> c;
  for (int i = 1; i <= n; i++) {
    l[i] = i;
    r[i] = n + 1;
    ms[i] = i;
  }
  for (int i = 1; i <= c; i++) {
    int a, b;
    string s;
    cin >> a >> b >> s;
    if (b <= a) {
      cout << im << endl;
      return 0;
    }
    ms[a] = max(ms[a], b);
    if (s == "LEFT")
      l[a] = max(l[a], b);
    else
      r[a] = min(r[a], b);
  }
  for (int i = 1; i <= n; i++) {
    if (l[i] >= r[i]) {
      cout << im << endl;
      return 0;
    }
  }
  sub1();
}
