#include <bits/stdc++.h>
using namespace std;
int N, C;
const int N_ = 1001000, C_ = 100500;
vector<int> L[N_], R[N_];
void IMPOSSIBLE() {
  puts("IMPOSSIBLE");
  exit(0);
}
int cur;
vector<int> res;
void solve(int u, int r) {
  if (u != cur) IMPOSSIBLE();
  if (!L[u].empty()) {
    int ch_u = min(++cur, *min_element(L[u].begin(), L[u].end()));
    int ch_r = *max_element(L[u].begin(), L[u].end());
    solve(ch_u, ch_r);
  }
  res.push_back(u);
  if (!R[u].empty()) {
    int ch_u = min(++cur, *min_element(R[u].begin(), R[u].end()));
    int ch_r = max(*max_element(R[u].begin(), R[u].end()), r);
    solve(ch_u, ch_r);
  } else if (cur < r) {
    solve(++cur, r);
  }
}
int main() {
  scanf("%d%d", &N, &C);
  for (int i = 1; i <= C; i++) {
    int a, b;
    char t[20];
    scanf("%d%d%s", &a, &b, t);
    if (a >= b) IMPOSSIBLE();
    (t[0] == 'L' ? L : R)[a].push_back(b);
  }
  cur = 1;
  solve(1, N);
  if (res.size() != N) IMPOSSIBLE();
  for (int i = 0; i < res.size(); i++) printf("%d ", res[i]);
  return 0;
}
