#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1e6 + 10;
void kill(bool b = true) {
  if (b) {
    puts("IMPOSSIBLE");
    exit(0);
  }
}
int N, M;
vector<int> A[MAXN][2];
int ch[MAXN][2];
int cuv = 1;
void dfs(int x, int smx) {
  assert(cuv == x);
  for (auto &v : A[x]) {
    sort((v).begin(), (v).end());
  }
  if (!A[x][0].empty()) {
    dfs(ch[x][0] = ++cuv, A[x][0].back());
  }
  if (!A[x][1].empty()) {
    kill(cuv >= A[x][1].front());
    smx = max(smx, A[x][1].back());
  }
  if (smx > cuv) {
    dfs(ch[x][1] = ++cuv, smx);
  }
}
void print(int x) {
  if (!x) {
    return;
  }
  print(ch[x][0]);
  printf("%d ", x);
  print(ch[x][1]);
}
int main() {
  if (fopen("input.txt", "r")) {
    freopen("input.txt", "r", stdin);
  }
  scanf("%d %d", &N, &M);
  int x, y;
  char buf[10];
  for (int i = 0; i < M; i++) {
    scanf("%d %d %s", &x, &y, buf);
    if (x >= y) {
      kill();
    }
    A[x][buf[0] == 'R'].push_back(y);
  }
  dfs(1, N);
  print(1);
  puts("");
}
