#include <bits/stdc++.h>
using namespace std;
const int N_MAX = 1000020, C_MAX = 100020;
int n, m;
vector<int> L[N_MAX], R[N_MAX];
bool input() {
  scanf("%d%d", &n, &m);
  int i;
  for (i = 0; i < m; i++) {
    int p, c;
    char t[9];
    scanf("%d%d%s", &p, &c, t);
    if (p >= c) return 0;
    if (t[0] == 'L')
      L[p].push_back(c);
    else
      R[p].push_back(c);
  }
  return 1;
}
vector<int> res;
int now = 1;
bool solve(int l, int r) {
  if (l != now) return 0;
  int ll, rr;
  if (!L[l].empty()) {
    ll = ++now;
    rr = *max_element(L[l].begin(), L[l].end());
    if (!solve(ll, rr)) return 0;
  }
  res.push_back(l);
  if (!R[l].empty()) {
    ll = min(++now, *min_element(R[l].begin(), R[l].end()));
    rr = max(*max_element(R[l].begin(), R[l].end()), r);
    if (!solve(ll, rr)) return 0;
  } else if (now < r) {
    if (!solve(++now, r)) return 0;
  }
  return 1;
}
int main() {
  if (input() && solve(1, n)) {
    int i;
    for (i = 0; i < res.size(); i++) printf("%d ", res[i]);
    puts("");
  } else
    puts("IMPOSSIBLE");
  return 0;
}
