#include <bits/stdc++.h>
using namespace std;
const int MOD(1000000007);
const int INF((1 << 30) - 1);
const int MAXN(105);
int n, m, a[MAXN], b[MAXN];
string s[MAXN];
bool flag[MAXN][MAXN];
vector<int> dp[MAXN][MAXN];
vector<int> DP(int f, int l) {
  if (flag[f][l]) return dp[f][l];
  flag[f][l] = true;
  if (f == l) {
    bool fail = false;
    for (int j = 0; j < m; j++) {
      if (a[j] == f) {
        if (s[j] == "LEFT" && (b[j] < f + 1 || b[j] > f)) {
          fail = true;
          break;
        }
        if (s[j] == "RIGHT" && (b[j] < f + 1 || b[j] > l)) {
          fail = true;
          break;
        }
      }
    }
    if (!fail)
      dp[f][l].push_back(f);
    else
      dp[f][l].push_back(-1);
    return dp[f][l];
  }
  for (int i = f; i <= l; i++) {
    bool fail = false;
    for (int j = 0; j < m; j++) {
      if (a[j] == f) {
        if (s[j] == "LEFT" && (b[j] < f + 1 || b[j] > i)) {
          fail = true;
          break;
        }
        if (s[j] == "RIGHT" && (b[j] < i + 1 || b[j] > l)) {
          fail = true;
          break;
        }
      }
    }
    if (fail) continue;
    if (i == f) {
      vector<int> t = DP(i + 1, l);
      if (t[0] != -1) {
        dp[f][l].push_back(f);
        for (int j = 0; j < t.size(); j++) dp[f][l].push_back(t[j]);
        break;
      }
    } else if (i == l) {
      vector<int> t = DP(f + 1, i);
      if (t[0] != -1) {
        for (int j = 0; j < t.size(); j++) dp[f][l].push_back(t[j]);
        dp[f][l].push_back(f);
        break;
      }
    } else {
      vector<int> t1 = DP(f + 1, i);
      vector<int> t2 = DP(i + 1, l);
      if (t1[0] != -1 && t2[0] != -1) {
        for (int j = 0; j < t1.size(); j++) dp[f][l].push_back(t1[j]);
        dp[f][l].push_back(f);
        for (int j = 0; j < t2.size(); j++) dp[f][l].push_back(t2[j]);
        break;
      }
    }
  }
  if (dp[f][l].size() == 0) dp[f][l].push_back(-1);
  return dp[f][l];
}
int main() {
  bool fail = false;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < m; i++) {
    scanf("%d%d", &a[i], &b[i]);
    cin >> s[i];
    if (a[i] == b[i]) fail = true;
  }
  for (int i = 1; i <= n; i++)
    for (int j = 1; j <= n; j++) flag[i][j] = false;
  DP(1, n);
  if (dp[1][n][0] == -1 || fail) {
    printf("IMPOSSIBLE");
  } else {
    for (int i = 0; i < n; i++) printf("%d ", dp[1][n][i]);
  }
}
