#include <bits/stdc++.h>
using namespace std;
int maxL[1000005];
int minP[1000005];
int maxS[1000005];
char s[100];
bool zle = false;
int L[1000005];
int P[1000005];
int rob(int v, int lb, int rb) {
  if (maxS[v] > rb || lb > rb) return -1;
  if (maxL[v] == -1) {
    L[v] = -1;
    if (lb == v && maxS[v] == v) {
      P[v] = -1;
      return v;
    }
    int w = rob(v + 1, max(lb, maxS[v]), rb);
    P[v] = v + 1;
    return w;
  }
  if (minP[v] == 1e9) {
    P[v] = -1;
    int w = rob(v + 1, max(lb, maxS[v]), rb);
    L[v] = v + 1;
    return w;
  }
  int w = rob(v + 1, maxL[v], min(rb, minP[v] - 1));
  if (w == -1) {
    ;
    return w;
  }
  L[v] = v + 1;
  int u = rob(w + 1, max(lb, maxS[v]), rb);
  P[v] = w + 1;
  return u;
}
void inorder(int v) {
  if (v == -1) return;
  inorder(L[v]);
  printf("%d ", v);
  inorder(P[v]);
}
int main() {
  int(n), (c);
  scanf("%d%d", &(n), &(c));
  ;
  for (int i = (0); i < (n + 1); ++i) maxL[i] = -1;
  for (int i = (0); i < (n + 1); ++i) minP[i] = 1e9;
  for (int i = (0); i < (n + 1); ++i) maxS[i] = i;
  for (int i = (0); i < (c); ++i) {
    int(x), (y);
    scanf("%d%d", &(x), &(y));
    ;
    scanf("%s", s);
    if (y <= x) zle = true;
    if (s[0] == 'L') maxL[x] = max(maxL[x], y);
    if (s[0] == 'R') minP[x] = min(minP[x], y);
    maxS[x] = max(maxS[x], y);
  }
  for (int i = (1); i < (n + 1); ++i) {
    if (maxL[i] != -1 && minP[i] != 1e9 && maxL[i] >= minP[i]) zle = true;
  }
  if (zle) {
    printf("IMPOSSIBLE\n");
    return 0;
  }
  int ans = rob(1, n, n);
  if (ans == -1) {
    printf("IMPOSSIBLE\n");
    return 0;
  }
  inorder(1);
  printf("\n");
}
