#include <bits/stdc++.h>
using namespace std;
inline void pisz(int n) { printf("%d\n", n); }
template <typename T, typename TT>
ostream& operator<<(ostream& s, pair<T, TT> t) {
  return s << "(" << t.first << "," << t.second << ")";
}
template <typename T>
ostream& operator<<(ostream& s, vector<T> t) {
  for (int(i) = 0; (i) < (((int)((t).size()))); ++(i)) s << t[i] << " ";
  return s;
}
void fail() {
  printf("IMPOSSIBLE");
  exit(0);
}
char s[233];
const int N = 1001001;
int maxLeft[N], minRight[N], maxRight[N];
vector<int> res;
int v;
void go(int atl) {
  ++v;
  int ai = v;
  if (maxLeft[ai] != 0) {
    go(maxLeft[ai]);
  }
  res.push_back(ai);
  if (minRight[ai] < v + 1) fail();
  (atl) = max((atl), (maxRight[ai]));
  ;
  if (atl <= v) return;
  go(atl);
}
int main() {
  int(n), (c);
  scanf("%d %d", &(n), &(c));
  for (int(i) = 1; (i) <= (n); ++(i)) {
    maxLeft[i] = maxRight[i] = 0;
    minRight[i] = 1001001001;
  }
  for (int(q) = 1; (q) <= (c); ++(q)) {
    int(ai), (bi);
    scanf("%d %d", &(ai), &(bi));
    if (ai >= bi) fail();
    scanf("%s", s);
    bool le = (0 == strcmp(s, "LEFT"));
    if (le) {
      (maxLeft[ai]) = max((maxLeft[ai]), (bi));
      ;
    } else {
      (maxRight[ai]) = max((maxRight[ai]), (bi));
      ;
      (minRight[ai]) = min((minRight[ai]), (bi));
      ;
    }
  }
  v = 0;
  go(n);
  for (__typeof(res.begin()) it = res.begin(); it != res.end(); it++)
    printf("%d ", *it);
}
