#include <bits/stdc++.h>
using namespace std;
int n;
bool ok = true;
char s[20];
int esq[1000010], dirmin[1000010], dirmax[1000010];
vector<int> ans;
int solve(int root, int put) {
  if (root == n + 1) return root;
  int x = root + 1;
  if (esq[root] != -1) x = solve(root + 1, esq[root]) + 1;
  if (x > dirmin[root]) {
    printf("IMPOSSIBLE\n");
    exit(0);
  }
  ans.push_back(root);
  if (dirmax[root] != -1) return solve(x, max(put, dirmax[root]));
  if (x > put) return max(root, x - 1);
  return solve(x, put);
}
int main() {
  int m;
  scanf(" %d %d", &n, &m);
  for (int i = 1; i <= n; i++) {
    esq[i] = -1;
    dirmax[i] = -1;
    dirmin[i] = 0x3f3f3f3f;
  }
  for (int i = 0; i < (m); ++i) {
    int a, b;
    scanf(" %d %d %s", &a, &b, s);
    if (b <= a) ok = false;
    if (s[0] == 'L')
      esq[a] = max(b, esq[a]);
    else {
      dirmin[a] = min(b, dirmin[a]);
      dirmax[a] = max(b, dirmax[a]);
    }
  }
  if (!ok) {
    printf("IMPOSSIBLE\n");
    return 0;
  }
  for (int i = 1; i <= n;) {
    int x = i + 1;
    if (esq[i] != -1) x = solve(i + 1, esq[i]) + 1;
    ans.push_back(i);
    if (x > dirmin[i]) {
      printf("IMPOSSIBLE\n");
      return 0;
    }
    i = x;
  }
  for (int i = 0; i < (ans.size()); ++i) {
    if (i) printf(" ");
    printf("%d", ans[i]);
  }
  printf("\n");
  return 0;
}
