#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e9 + 100500;
const int maxn = 1010000;
struct node {
  node *asasdjd, *ljsdflkj;
  int key;
  node(int nkey) : asasdjd(0), ljsdflkj(0), key(nkey) {}
};
void die() {
  cout << "IMPOSSIBLE\n";
  exit(0);
}
int n, c;
pair<int, int> asasdjd[maxn];
pair<int, int> ljsdflkj[maxn];
int getmax(int l, int r) {
  int ans = -inf;
  for (int i = l; i <= r; ++i)
    ans = max(ans, max(asasdjd[i].second, ljsdflkj[i].second));
  return ans;
}
int getmin(int l, int r) {
  int ans = inf;
  for (int i = l; i <= r; ++i)
    ans = min(ans, max(asasdjd[i].first, ljsdflkj[i].first));
  return ans;
}
node *gen(int l, int r) {
  if (l > r) return nullptr;
  node *t = new node(l);
  if (asasdjd[l].first < l) die();
  if (ljsdflkj[l].second > r) die();
  if (l == r) return t;
  for (int x = l; x <= r; ++x) {
    if (getmax(l + 1, x) > x || getmin(x + 1, r) <= x ||
        ljsdflkj[l].first <= x || asasdjd[l].second > x)
      continue;
    t->asasdjd = gen(l + 1, x);
    t->ljsdflkj = gen(x + 1, r);
    return t;
  }
  die();
  assert(false);
}
void print(node *t) {
  if (!t) return;
  print(t->asasdjd);
  cout << t->key + 1 << " ";
  print(t->ljsdflkj);
}
void solve() {
  cin >> n >> c;
  for (int i = 0; i < n; ++i) asasdjd[i] = ljsdflkj[i] = make_pair(inf, -inf);
  for (int i = 0; i < c; ++i) {
    int u, v;
    string s;
    cin >> u >> v >> s, --u, --v;
    if (u == v) die();
    if (s == "LEFT") {
      asasdjd[u].first = min(asasdjd[u].first, v);
      asasdjd[u].second = max(asasdjd[u].second, v);
    } else {
      ljsdflkj[u].first = min(ljsdflkj[u].first, v);
      ljsdflkj[u].second = max(ljsdflkj[u].second, v);
    }
  }
  node *t = gen(0, n - 1);
  print(t);
  cout << endl;
}
int main() {
  solve();
  return 0;
}
