#include <bits/stdc++.h>
using namespace std;
int n, m, nodes;
int node[1100000][2];
vector<int> l[1100000], r[1100000];
void dfs(int x, int mx) {
  int num = x;
  for (int i = 0; i < (int)l[x].size(); ++i) {
    int y = l[x][i];
    if (y <= nodes) {
      printf("IMPOSSIBLE\n");
      exit(0);
    }
    num = max(num, y);
  }
  if (num > x) {
    nodes++;
    node[x][0] = nodes;
    dfs(nodes, num);
  }
  num = x;
  for (int i = 0; i < (int)r[x].size(); ++i) {
    int y = r[x][i];
    if (y <= nodes) {
      printf("IMPOSSIBLE\n");
      exit(0);
    }
    num = max(num, y);
  }
  num = max(mx, num);
  if (num > nodes) {
    nodes++;
    node[x][1] = nodes;
    dfs(nodes, num);
  }
}
int cnt = 0;
void dfs2(int x) {
  if (x == -1) return;
  dfs2(node[x][0]);
  cnt++;
  printf("%d%c", x, cnt == n ? '\n' : ' ');
  dfs2(node[x][1]);
}
int main() {
  scanf("%d%d", &n, &m);
  memset(node, -1, sizeof node);
  char buf[100];
  for (int i = 1; i <= m; ++i) {
    int a, b;
    scanf("%d%d%s", &a, &b, buf);
    if (b <= a) {
      printf("IMPOSSIBLE\n");
      return 0;
    }
    if (buf[0] == 'L')
      l[a].push_back(b);
    else
      r[a].push_back(b);
  }
  nodes = 1;
  dfs(1, n);
  dfs2(1);
  return 0;
}
