#include <bits/stdc++.h>
using namespace std;
const int N = 1000005;
int n, i, j, a[N], b[N], l[N], r[N], y;
int c, u, R[N];
bool ele;
char s[10];
vector<int> ans;
void go(int x, int y) {
  if (u >= y) ele = 1;
  x = ((x) > (R[u]) ? (x) : (R[u]));
  if (x >= y) ele = 1;
  int o = u;
  if (l[o] > o) {
    u++;
    go(l[o], ((y) < (r[o]) ? (y) : (r[o])));
  }
  ans.push_back(o);
  if (u < x) {
    u++;
    go(x, y);
  }
}
int main() {
  scanf("%d%d", &n, &c);
  for (i = 1; i <= n; i++) l[i] = R[i] = -200000000, r[i] = 200000000;
  for (i = 1; i <= c; i++) {
    scanf("%d%d%s", &a[i], &b[i], &s);
    if (b[i] <= a[i]) ele = 1;
    if (s[0] == 'L')
      l[a[i]] = ((l[a[i]]) > (b[i]) ? (l[a[i]]) : (b[i]));
    else
      r[a[i]] = ((r[a[i]]) < (b[i]) ? (r[a[i]]) : (b[i])),
      R[a[i]] = ((R[a[i]]) > (b[i]) ? (R[a[i]]) : (b[i]));
  }
  for (i = 1; i <= n; i++)
    if (r[i] <= l[i]) {
      cout << "IMPOSSIBLE" << endl;
      return 0;
    }
  u = 1;
  go(n, n + 1);
  if (ele || ans.size() != n) {
    cout << "IMPOSSIBLE" << endl;
    return 0;
  }
  for (i = 0; i < ans.size(); i++) printf("%d ", ans[i]);
  printf("\n");
  return 0;
}
