#include <bits/stdc++.h>
using namespace std;
int c, flag, e, n, q;
int l[1000100], r[1000100], t[1000100], v[1000100];
void open() {
  freopen("D.in", "r", stdin);
  freopen("D.out", "w", stdout);
}
void close() {
  fclose(stdin);
  fclose(stdout);
}
void dfs(int i, int g, int h) {
  e++;
  g = max(g, t[i]);
  if (r[i] <= l[i] || g >= h) {
    flag = 1;
    return;
  }
  if (l[i] != -1) {
    dfs(i + 1, l[i], min(r[i], h));
  }
  v[c++] = i;
  if (e <= g) dfs(e, g, h);
}
void work() {
  scanf("%d", &n);
  scanf("%d", &q);
  for (int i = 0, END = n - 1; i <= END; i++) l[i] = -1, r[i] = n, t[i] = -1;
  char str[10];
  int i, j;
  for (int hhh = 1, END = q; hhh <= END; hhh++) {
    scanf("%d%d%s", &i, &j, str);
    i--;
    j--;
    if (i >= j) {
      printf("IMPOSSIBLE\n");
      close();
      exit(0);
    }
    if (str[0] == 'L')
      l[i] = max(l[i], j);
    else
      r[i] = min(r[i], j), t[i] = max(t[i], j);
  }
  dfs(0, n - 1, n);
  if (flag) {
    printf("IMPOSSIBLE\n");
    close();
    exit(0);
  } else
    for (int i = 0, END = n - 1; i <= END; i++) printf("%d ", v[i] + 1);
}
int main() {
  work();
  close();
  return 0;
}
