#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000005;
const int MAXM = 100005;
struct NODE {
  int lchd, rchd;
  int lm, rm;
  int limit;
} node[MAXN];
struct CONS {
  int par, chd;
  bool left;
  bool operator<(const CONS& b) const {
    if (par != b.par) {
      return par < b.par;
    } else if (left != b.left) {
      return left;
    } else {
      return chd < b.chd;
    }
  }
} cons[MAXM];
int n, m;
bool MakeTree(int id, int r, int b) {
  if (b >= r) {
    return false;
  }
  if (node[id].lm > 0) {
    if (node[id].lm <= id) {
      return false;
    }
    if (!MakeTree(id + 1, node[id].rm > 0 ? min(r, node[id].rm) : r,
                  node[id].lm)) {
      return false;
    }
    node[id].lchd = id + 1;
    node[id].lm = max(id + 1, node[id + 1].limit);
  } else {
    node[id].lchd = 0;
  }
  if (node[id].rm > 0 || b > max(id, node[id].lm)) {
    if (node[id].limit >= r) {
      return false;
    }
    if (!MakeTree(max(node[id].lm + 1, id + 1), r, max(b, node[id].limit))) {
      return false;
    }
    node[id].rchd = max(node[id].lm + 1, id + 1);
    node[id].rm = node[id].rchd;
    node[id].limit = node[node[id].rchd].limit;
  } else {
    node[id].rchd = 0;
    node[id].limit = id;
    if (node[id].lchd) {
      node[id].limit = max(node[id].limit, node[node[id].lchd].limit);
    }
  }
  return true;
}
static int cnt = 0;
void PutTree(int id) {
  if (node[id].lchd) {
    PutTree(node[id].lchd);
  }
  printf("%d ", id);
  cnt++;
  if (node[id].rchd) {
    PutTree(node[id].rchd);
  }
}
int main() {
  int i, a;
  char str[10];
  bool flag = true;
  scanf("%d%d", &n, &m);
  for (i = 0; i < m; i++) {
    scanf("%d%d%s", &cons[i].par, &cons[i].chd, str);
    cons[i].left = (str[0] == 'L');
    if (cons[i].chd <= cons[i].par) {
      flag = false;
    }
  }
  sort(cons, cons + m);
  a = cons[0].par;
  for (i = 0; i < m;) {
    while (cons[i].par == a && cons[i].left) {
      i++;
    }
    if (i > 0 && cons[i - 1].par == a && cons[i - 1].left)
      node[a].lm = cons[i - 1].chd;
    if (cons[i].par == a) {
      node[a].rm = cons[i].chd;
      while (cons[i].par == a) {
        i++;
      }
      node[a].limit = cons[i - 1].chd;
      if (node[a].rm <= node[a].lm) {
        flag = false;
      }
    } else {
      node[a].rm = 0;
      node[a].limit = node[a].lm;
    }
    a = cons[i].par;
  }
  if (flag && MakeTree(1, n + 1, n)) {
    PutTree(1);
  } else {
    printf("IMPOSSIBLE\n");
  }
  return 0;
}
