#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000006;
int OGR[MAXN][3];
void NIE() {
  puts("IMPOSSIBLE");
  exit(0);
}
vector<int> LE[MAXN], PR[MAXN], ANS;
int dfs(int u, int mus) {
  for (typeof(LE[u].begin()) it = LE[u].begin(); it != LE[u].end(); ++it)
    if (*it <= u) NIE();
  for (typeof(PR[u].begin()) it = PR[u].begin(); it != PR[u].end(); ++it)
    if (*it <= u) NIE();
  int le = -1, ri = MAXN;
  for (typeof(LE[u].begin()) it = LE[u].begin(); it != LE[u].end(); ++it)
    le = max(le, *it);
  int tam = le == -1 ? u : dfs(u + 1, le);
  ANS.push_back(u);
  for (typeof(PR[u].begin()) it = PR[u].begin(); it != PR[u].end(); ++it)
    ri = min(ri, *it);
  if (ri == MAXN && mus <= tam) return tam;
  if (ri <= tam) NIE();
  for (typeof(PR[u].begin()) it = PR[u].begin(); it != PR[u].end(); ++it)
    mus = max(mus, *it);
  return dfs(tam + 1, mus);
}
int main() {
  char temp[123];
  int c, n;
  scanf("%d%d", &n, &c);
  for (int i = 0; i < c; ++i) {
    scanf("%d%d %s", &OGR[i][0], &OGR[i][1], temp);
    OGR[i][2] = temp[0] == 'L';
  }
  for (int i = 0; i < c; ++i)
    for (int j = 0; j < 2; ++j) OGR[i][j]--;
  for (int i = 0; i < c; ++i)
    if (OGR[i][2])
      LE[OGR[i][0]].push_back(OGR[i][1]);
    else
      PR[OGR[i][0]].push_back(OGR[i][1]);
  dfs(0, n - 1);
  for (typeof(ANS.begin()) it = ANS.begin(); it != ANS.end(); ++it)
    printf("%d ", *it + 1);
  puts("");
  return 0;
}
