#include <bits/stdc++.h>
using namespace std;
vector<int> lmax, rmin, rmax;
vector<int> ans;
int n, m;
bool imp;
int search(int index, int ma, int offset) {
  if (index >= n) {
    return -1;
  }
  int mid = index;
  if (lmax[index] != -1) {
    mid = max(mid, search(index + 1, lmax[index], offset));
    if (imp) return 0;
  }
  ans[offset + mid - index] = index;
  if (mid >= rmin[index]) {
    imp = true;
    return 0;
  }
  if (mid + 1 <= max(rmax[index], ma)) {
    int rmid = search(mid + 1, max(rmax[index], ma), offset + mid - index + 1);
    if (rmid > mid) mid = rmid;
  }
  return mid;
}
int main() {
  cin >> n >> m;
  lmax.resize(n);
  rmin.resize(n);
  rmax.resize(n);
  ans.resize(n);
  for (int i = 0; i < n; i++) {
    lmax[i] = -1;
    rmin[i] = n;
    rmax[i] = -1;
    ans[i] = 0;
  }
  imp = false;
  for (int i = 0; i < m; i++) {
    int a, b;
    string c;
    cin >> a >> b >> c;
    a--;
    b--;
    if (b <= a) {
      imp = true;
      break;
    }
    if (c[0] == 'L') {
      lmax[a] = max(lmax[a], b);
    } else {
      rmin[a] = min(rmin[a], b);
      rmax[a] = max(rmax[a], b);
    }
  }
  search(0, n - 1, 0);
  if (imp) {
    cout << "IMPOSSIBLE" << endl;
    return 0;
  }
  for (int i = 0; i < n; i++) {
    cout << ans[i] + 1;
    if (i == n - 1)
      cout << endl;
    else
      cout << " ";
  }
  return 0;
}
