#include <bits/stdc++.h>
#pragma comment(linker, "/STACK:102400000,102400000")
using namespace std;
const int inf = 1000000007;
const long long linf = 1000000000000000000LL;
const unsigned long long ulinf = (1ULL << 63) - 10ULL;
const double eps = 0.000001;
const double pi = 3.14159265358979323846;
template <class T>
T abs(T a) {
  return a >= 0 ? a : -a;
}
template <class T>
int sign(T a) {
  return a > eps ? 1 : a < -eps ? -1 : 0;
}
template <class T>
T sqr(T a) {
  return a * a;
}
template <class T>
T gcd(T a, T b) {
  return b ? gcd(b, a % b) : a;
}
template <class T>
T mod(T a, T b) {
  T ret = a % b;
  if (ret < 0) ret += b;
  return ret;
}
template <class T>
T lowbit(T x) {
  return x & -x;
}
long long addmod(long long a, long long b, long long c) {
  return ((a + b) % c + c) % c;
}
long long mulmod(long long a, long long b, long long c) {
  if (b == 0LL) return 0LL;
  long long ret = mulmod(a, b >> 1, c);
  ret = (ret + ret) % c;
  if (b & 1LL) ret = (ret + a) % c;
  return ret;
}
long long powmod(long long a, long long b, long long c) {
  if (b == 0LL) return 1LL;
  long long ret = powmod(a, b >> 1, c);
  ret = ret * ret % c;
  if (b & 1LL) ret = ret * a % c;
  return ret;
}
long long modinv(long long a, long long b) { return powmod(a, b - 2LL, b); }
template <class T>
void maxe(T &a, T b) {
  if (a < b) a = b;
}
template <class T>
void mine(T &a, T b) {
  if (a > b) a = b;
}
int iszero(double a) { return a <= eps && a >= -eps; }
template <class T>
void geti(T &a) {
  a = 0;
  int b = 0;
  char c;
  while ((c = getchar()) == ' ' || c == '\n')
    ;
  if (c == '-')
    b = 1;
  else
    a = c - 48;
  while ((c = getchar()) != ' ' && c != '\n') a = a * 10 + c - 48;
  if (b) a = -a;
}
void fileio_in_out() {
  freopen(".in", "r", stdin);
  freopen(".out", "w", stdout);
}
void fileio_txt() {
  freopen("input.txt", "r", stdin);
  freopen("output.txt", "w", stdout);
}
const int N = 1111111;
const int M = 222;
const int K = 20;
const long long md = inf;
int test;
int n, m, k, ans;
char s[11];
int aa[N];
vector<int> lson[N], rson[N];
int dfs(int l, int r) {
  int ret = l;
  if (lson[l].size()) {
    int mx = 0;
    for (int i = 0; i < lson[l].size(); i++) maxe(mx, lson[l][i]);
    ret = dfs(l + 1, mx);
    if (!ret) return 0;
  }
  aa[++k] = l;
  if (rson[l].size()) {
    int mx = 0;
    for (int i = 0; i < rson[l].size(); i++) {
      maxe(mx, rson[l][i]);
      if (rson[l][i] <= ret) return 0;
    }
    maxe(r, mx);
  }
  if (ret < r) ret = dfs(ret + 1, r);
  return ret;
}
int getans() {
  for (int i = 1; i <= m; i++) {
    int x, y;
    scanf("%d%d%s", &x, &y, s);
    if (x >= y) return 0;
    if (s[0] == 'L')
      lson[x].push_back(y);
    else
      rson[x].push_back(y);
  }
  int ret = dfs(1, n);
  return ret;
}
int main() {
  scanf("%d%d", &n, &m);
  ans = getans();
  if (ans) {
    for (int i = 1; i <= n; i++) printf("%d ", aa[i]);
    puts("");
  } else
    puts("IMPOSSIBLE");
  return 0;
}
