#include <bits/stdc++.h>
using namespace std;
long long gcd(long long a, long long b) { return b == 0 ? a : gcd(b, a % b); }
int n, ncond;
bool anyleft[1000000];
bool anyrght[1000000];
int minleft[1000000];
int maxleft[1000000];
int minrght[1000000];
int maxrght[1000000];
int ret[1000000], nret;
int create(int root, int contained) {
  if (contained < root) return -1;
  if (!anyleft[root] && !anyrght[root] && contained == root) {
    ret[nret++] = root;
    return 1;
  }
  int lroot = root + 1, rroot, nleft = 0, nrght = 0;
  if (anyleft[root] && minleft[root] < lroot) return -1;
  if (anyleft[root]) {
    nleft = create(lroot, maxleft[root]);
    if (nleft == -1) return -1;
    rroot = lroot + nleft;
  } else {
    rroot = lroot;
  }
  if (anyrght[root] && minrght[root] < rroot) return -1;
  ret[nret++] = root;
  if (anyrght[root] || contained >= rroot) {
    nrght = create(rroot, max(anyrght[root] ? maxrght[root] : rroot,
                              contained < rroot ? rroot : contained));
    if (nrght == -1) return -1;
  }
  return nleft + 1 + nrght;
}
void run() {
  scanf("%d%d", &n, &ncond);
  for (int i = (0); i < (n); ++i) anyleft[i] = anyrght[i] = false;
  for (int i = (0); i < (ncond); ++i) {
    int a, b;
    char s[10];
    scanf("%d%d%s", &a, &b, s);
    --a, --b;
    if (strcmp(s, "LEFT") == 0) {
      if (!anyleft[a]) anyleft[a] = true, minleft[a] = maxleft[a] = b;
      if (b < minleft[a]) minleft[a] = b;
      if (b > maxleft[a]) maxleft[a] = b;
    } else if (strcmp(s, "RIGHT") == 0) {
      if (!anyrght[a]) anyrght[a] = true, minrght[a] = maxrght[a] = b;
      if (b < minrght[a]) minrght[a] = b;
      if (b > maxrght[a]) maxrght[a] = b;
    }
  }
  nret = 0;
  int res = create(0, n - 1);
  if (res == -1) {
    printf("IMPOSSIBLE\n");
    return;
  }
  for (int i = (0); i < (nret); ++i) {
    if (i != 0) printf(" ");
    printf("%d", ret[i] + 1);
  }
  puts("");
}
int main() {
  run();
  return 0;
}
