#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1100000;
vector<int> l[MAXN], r[MAXN];
int TP = 0;
int tree[MAXN];
int n;
int go(int root, int treeLowerBound) {
  int maxLeft = root;
  for (typeof((l[root]).begin()) c = (l[root]).begin(); c != (l[root]).end();
       c++)
    if (*c > maxLeft) maxLeft = *c;
  if (maxLeft > treeLowerBound) treeLowerBound = maxLeft;
  for (typeof((r[root]).begin()) c = (r[root]).begin(); c != (r[root]).end();
       c++)
    if (*c > treeLowerBound) treeLowerBound = *c;
  if (maxLeft > root) {
    maxLeft = go(root + 1, maxLeft);
    if (maxLeft == -1) return -1;
  } else
    maxLeft = root + 1;
  tree[TP++] = root;
  for (typeof((r[root]).begin()) c = (r[root]).begin(); c != (r[root]).end();
       c++)
    if (*c < maxLeft) return -1;
  if (maxLeft <= treeLowerBound)
    return go(maxLeft, treeLowerBound);
  else
    return maxLeft;
}
int main() {
  int c;
  scanf("%d%d", &n, &c);
  bool palante = true;
  for (int i = 0; i < (int)(c); i++) {
    int a, b;
    char s[16];
    scanf("%d %d %s", &a, &b, s);
    a--;
    b--;
    if (a >= b) palante = false;
    if (strcmp(s, "LEFT") == 0)
      l[a].push_back(b);
    else
      r[a].push_back(b);
  }
  if (palante && go(0, n - 1) >= 0) {
    for (int i = 0; i < (int)(n); i++) {
      if (i) printf(" ");
      printf("%d", tree[i] + 1);
    }
    printf("\n");
  } else
    printf("IMPOSSIBLE\n");
  return 0;
}
