#include <bits/stdc++.h>
using namespace std;
vector<int> ans;
int a[1000005][2], b[1000005][2];
int dfs(int x, int y) {
  int maxx = x;
  if (a[x][1] > maxx) maxx = max(maxx, dfs(x + 1, a[x][1]));
  ans.push_back(x + 1);
  if (maxx >= b[x][0]) {
    printf("IMPOSSIBLE\n");
    exit(0);
  }
  if (b[x][1] > maxx || y > maxx)
    maxx = max(maxx, dfs(maxx + 1, max(y, b[x][1])));
  return maxx;
}
int main() {
  char s[10];
  int n, m, x, y;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    a[i][0] = b[i][0] = n;
    a[i][1] = b[i][1] = i;
  }
  for (int i = 0; i < m; i++) {
    scanf("%d%d%s", &x, &y, &s);
    x--, y--;
    if (s[0] == 'L') {
      a[x][0] = min(a[x][0], y);
      a[x][1] = max(a[x][1], y);
    } else {
      b[x][0] = min(b[x][0], y);
      b[x][1] = max(b[x][1], y);
    }
    if (y <= x) {
      printf("IMPOSSIBLE\n");
      return 0;
    }
  }
  dfs(0, n - 1);
  for (int i = 0; i < n; i++) printf("%d ", ans[i]);
  return 0;
}
