#include <bits/stdc++.h>
using namespace std;
int build(int root, vector<int> &ll, vector<int> &lr, vector<int> &rl,
          vector<int> &rr, int m, vector<int> &ans) {
  if (lr[root] == -1 && rr[root] == -1) {
    ans.push_back(root);
    if (root >= m) {
      return root;
    }
    return build(root + 1, ll, lr, rl, rr, m, ans);
  }
  if (lr[root] == -1) {
    if (rr[root] <= root || rl[root] <= root) {
      cout << "IMPOSSIBLE";
      exit(0);
    }
    ans.push_back(root);
    return build(root + 1, ll, lr, rl, rr, max(m, rr[root]), ans);
  }
  if (rr[root] == -1) {
    if (ll[root] <= root || lr[root] <= root) {
      cout << "IMPOSSIBLE";
      exit(0);
    }
    int x = build(root + 1, ll, lr, rl, rr, max(m, lr[root]), ans);
    ans.push_back(root);
    return x;
  }
  if (lr[root] <= root || rl[root] <= root || ll[root] <= root ||
      rr[root] <= root || lr[root] >= rl[root]) {
    cout << "IMPOSSIBLE" << endl;
    exit(0);
  }
  int mid = build(root + 1, ll, lr, rl, rr, lr[root], ans);
  if (mid >= rl[root]) {
    cout << "IMPOSSIBLE";
    exit(0);
  }
  ans.push_back(root);
  return build(mid + 1, ll, lr, rl, rr, max(m, rr[root]), ans);
}
int main() {
  int n, c;
  cin >> n >> c;
  vector<int> ll(n + 1, n + 1), lr(n + 1, -1), rl(n + 1, n + 1), rr(n + 1, -1);
  for (int i = 0; i < c; ++i) {
    int a, b;
    string s;
    cin >> a >> b >> s;
    if (s == "LEFT") {
      ll[a] = min(ll[a], b);
      lr[a] = max(lr[a], b);
    } else {
      rl[a] = min(rl[a], b);
      rr[a] = max(rr[a], b);
    }
  }
  vector<int> ans;
  if (build(1, ll, lr, rl, rr, n, ans) != n) {
    cout << "IMPOSSIBLE";
    return 0;
  }
  for (int i = 0; i < n; ++i) {
    cout << ans[i] << ' ';
  }
  return 0;
}
