#include <bits/stdc++.h>
using namespace std;
int mc[1000001], ml[1000001], mr[1000001];
int tk[1000001];
int ans[1000001];
int n;
int bit[1000001];
void upd(int i, int val) {
  if (i > n) return;
  bit[i] = max(bit[i], val);
  int t = i & (-i);
  upd(i + t, val);
}
int gm(int i) {
  if (i == 0) return 0;
  int t = i & (-i);
  return max(bit[i], gm(i - t));
}
bool make(int i, int j, int a, int b) {
  if (i > j) return 1;
  int totake = i;
  if (ml[i] == 0) {
    ans[a] = i;
    return make(i + 1, j, a + 1, b);
  }
  totake = tk[i];
  if (totake < mr[i]) {
    ans[a + totake - i] = i;
    if (make(i + 1, totake, a, a + totake - i - 1))
      return make(totake + 1, j, a + totake - i + 1, b);
  } else
    return 0;
}
int main() {
  int c;
  cin >> n >> c;
  for (int i = 0; i <= n; ++i) {
    mc[i] = i;
    ml[i] = 0;
    mr[i] = n + 1;
    ans[i] = 0;
    bit[i] = 0;
    tk[i] = 0;
  }
  bool cm = 1;
  for (int i = 0; i < c; ++i) {
    int a, b;
    string s;
    cin >> a >> b >> s;
    if (a >= b) cm = 0;
    mc[a] = max(mc[a], b);
    if (s[0] == 'L') {
      ml[a] = max(ml[a], b);
    } else {
      mr[a] = min(mr[a], b);
    }
  }
  for (int i = n; i >= 1; --i) {
    if (ml[i] >= mr[i]) cm = 0;
    if (ml[i] != 0) tk[i] = gm(ml[i]);
    upd(i, mc[i]);
    upd(i, gm(mc[i]));
  }
  if (!cm) {
    cout << "IMPOSSIBLE\n";
    return 0;
  }
  cm = make(1, n, 1, n);
  if (cm) {
    for (int i = 1; i <= n; ++i) cout << ans[i] << " ";
  } else
    cout << "IMPOSSIBLE\n";
  return 0;
}
