#include <bits/stdc++.h>
using namespace std;
vector<int> L[1000005], R[1000005];
char s[10];
int last[1000005], lastL[1000005];
set<int> S;
int Rchild[1000005];
bool added[1000005];
int main() {
  int n, c;
  scanf("%d%d", &n, &c);
  for (int i = (0); i < int(c); ++i) {
    int a, b;
    scanf("%d%d%s", &a, &b, s);
    --a;
    --b;
    if (s[0] == 'L')
      L[a].push_back(b);
    else
      R[a].push_back(b);
    if (b <= a) {
      puts("IMPOSSIBLE");
      return 0;
    }
  }
  for (int i = (0); i < int(n); ++i) {
    S.insert(i);
    last[i] = i;
  }
  for (int i = (n)-1; i >= int(0); --i) {
    for (int j = (0); j < int(L[i].size()); ++j) {
      for (auto it = S.upper_bound(i); it != S.end() && *it <= L[i][j];) {
        S.erase(it);
        it = S.upper_bound(i);
      }
    }
    int stop;
    auto it = S.upper_bound(i);
    if (it == S.end())
      stop = n;
    else
      stop = *it;
    Rchild[i] = stop;
    for (int j = (0); j < int(R[i].size()); ++j) {
      if (R[i][j] < Rchild[i]) {
        puts("IMPOSSIBLE");
        return 0;
      }
      for (auto it = S.upper_bound(i); it != S.end() && *it <= R[i][j];) {
        S.erase(it);
        it = S.upper_bound(i);
      }
    }
  }
  stack<int> s;
  s.push(0);
  while (!s.empty()) {
    int cur = s.top();
    s.pop();
    if (cur < 0) {
      printf("%d ", -cur);
      continue;
    }
    if (cur >= n) continue;
    if (!added[Rchild[cur]]) {
      added[Rchild[cur]] = 1;
      s.push(Rchild[cur]);
    }
    s.push(-cur - 1);
    if (Rchild[cur] > cur + 1) {
      s.push(cur + 1);
    }
  }
}
