#include <bits/stdc++.h>
using namespace std;
const int N = 105;
int a[N], b[N];
char type[N];
int dp[N][N];
int f(int l, int mid, int r, int x) {
  if (x < l || x > r) return 2;
  if (x == l) return 0;
  if (x <= mid) return -1;
  return 1;
}
void go(int l, int r) {
  if (l > r) return;
  int mid = dp[l][r];
  if (l != r) go(l + 1, mid);
  cout << l << " ";
  if (l != r) go(mid + 1, r);
}
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  int n, q;
  cin >> n >> q;
  for (int i = 1; i <= q; i++) {
    cin >> a[i] >> b[i];
    if (a[i] >= b[i]) {
      cout << "IMPOSSIBLE" << endl;
      return 0;
    }
    string s;
    cin >> s;
    type[i] = s[0];
  }
  for (int i = 1; i <= n + 1; i++) dp[i][i - 1] = i;
  for (int len = 1; len <= n; len++) {
    for (int l = 1; l + len - 1 <= n; l++) {
      int r = l + len - 1;
      for (int d = l; d <= r; d++) {
        if (!dp[l + 1][d] || !dp[d + 1][r]) continue;
        bool good = true;
        for (int i = 1; i <= q; i++) {
          int s1 = f(l, d, r, a[i]);
          int s2 = f(l, d, r, b[i]);
          if (s1 == 2 || s2 == 2) continue;
          if (s2 == 0)
            good = false;
          else if (s1 == 0) {
            if (s2 == 1 && type[i] == 'L') good = false;
            if (s2 == -1 && type[i] == 'R') good = false;
          } else if (s1 != s2)
            good = false;
          if (!good) break;
        }
        if (good) {
          dp[l][r] = d;
          break;
        }
      }
    }
  }
  if (!dp[1][n]) {
    cout << "IMPOSSIBLE" << endl;
    return 0;
  }
  go(1, n);
}
