#include <bits/stdc++.h>
using namespace std;
int l[1000007][2];
int r[1000007][2];
int n, c;
bool p;
int ans[1000007];
int mx;
void check(int c) {
  mx = max(mx, c);
  if ((l[c][1] && l[c][0] <= c) || (r[c][1] && r[c][0] <= c) ||
      (r[c][1] && l[c][1] && r[c][0] <= l[c][1])) {
    p = false;
    return;
  }
  while (mx < l[c][1]) check(mx + 1);
  if (r[c][1] && mx >= r[c][0]) {
    p = false;
    return;
  }
  ++ans[0];
  ans[ans[0]] = c;
  while (mx < r[c][1]) check(mx + 1);
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  for (int i = 0; i < 1000007; ++i) {
    l[i][0] = 999999999;
    r[i][0] = 999999999;
  }
  cin >> n >> c;
  int a, b;
  string s;
  for (int i = 0; i < c; ++i) {
    cin >> a >> b >> s;
    if (s == "LEFT") {
      l[a][0] = min(l[a][0], b);
      l[a][1] = max(l[a][1], b);
    } else {
      r[a][0] = min(r[a][0], b);
      r[a][1] = max(r[a][1], b);
    }
  }
  p = true;
  mx = 0;
  while (mx < n) check(mx + 1);
  if (p) {
    for (int i = 1; i <= n; ++i) cout << ans[i] << " ";
  } else {
    cout << "IMPOSSIBLE" << endl;
  }
}
