#include <bits/stdc++.h>
using namespace std;
const double PI = acos(-1.0);
const double EPS = 1e-7;
const int INF = 1000000000;
char buf[100];
int maxl[2000000];
int maxr[2000000];
int minl[2000000];
int minr[2000000];
pair<int, int> g[2000000];
int n;
int X = 0;
void dfs(int, int);
void add_dfs(int x, int mm) {
  if (X > mm) return;
  if (g[x].second == -1) {
    g[x].second = X;
    X++;
    dfs(g[x].second, mm);
  }
  add_dfs(g[x].second, mm);
}
bool OK = true;
void dfs(int x, int mm) {
  if (X > minl[x]) OK = false;
  if (X <= maxl[x]) {
    g[x].first = X;
    X++;
    dfs(g[x].first, maxl[x]);
  }
  if (X > minr[x]) OK = false;
  if (X <= maxr[x]) {
    g[x].second = X;
    X++;
    dfs(g[x].second, maxr[x]);
  }
  add_dfs(x, mm);
}
vector<int> res;
void dfs2(int x) {
  if (g[x].first != -1) dfs2(g[x].first);
  res.push_back(x);
  if (g[x].second != -1) dfs2(g[x].second);
}
int main() {
  int m;
  scanf("%d%d", &n, &m);
  for (int i = 0; i < n; i++) {
    maxl[i] = 0;
    maxr[i] = 0;
    minl[i] = n;
    minr[i] = n;
    g[i] = make_pair(-1, -1);
  }
  for (int i = 0; i < m; i++) {
    int x, y;
    scanf("%d%d", &x, &y);
    x--;
    y--;
    scanf("%s", buf);
    if (buf[0] == 'L') {
      maxl[x] = max(maxl[x], y);
      minl[x] = min(minl[x], y);
    } else {
      maxr[x] = max(maxr[x], y);
      minr[x] = min(minr[x], y);
    }
  }
  X = 1;
  dfs(0, n - 1);
  dfs2(0);
  if (!OK)
    printf("IMPOSSIBLE\n");
  else {
    for (int i = 0; i < res.size(); i++) {
      printf("%d ", res[i] + 1);
    }
    printf("\n");
  }
}
