#include <bits/stdc++.h>
using namespace std;
const long double eps = 1e-9;
const int inf = (1 << 30) - 1;
const long long inf64 = ((long long)1 << 62) - 1;
const long double pi = acos(-1);
template <class T>
T sqr(T x) {
  return x * x;
}
template <class T>
T abs(T x) {
  return x < 0 ? -x : x;
}
const int MAXN = 1200 * 1000;
char str[10];
int tree_max[4 * MAXN];
void build_max(int v, int left, int right, int arr[]) {
  if (left == right)
    tree_max[v] = arr[left];
  else {
    int med = (left + right) / 2;
    build_max(2 * v, left, med, arr);
    build_max(2 * v + 1, med + 1, right, arr);
    tree_max[v] = max(tree_max[2 * v], tree_max[2 * v + 1]);
  }
}
int max_tree(int v, int t_left, int t_right, int left, int right) {
  if (left > right) {
    return -inf;
  }
  if (left == t_left && right == t_right) {
    return tree_max[v];
  }
  int t_med = (t_left + t_right) / 2;
  return max(
      max_tree(2 * v, t_left, t_med, left, min(right, t_med)),
      max_tree(2 * v + 1, t_med + 1, t_right, max(left, t_med + 1), right));
}
void update_max(int v, int t_left, int t_right, int pos, int new_val) {
  if (t_left == t_right) {
    tree_max[v] = new_val;
  } else {
    int t_med = (t_left + t_right) / 2;
    if (pos > t_med) {
      update_max(2 * v + 1, t_med + 1, t_right, pos, new_val);
    } else {
      update_max(2 * v, t_left, t_med, pos, new_val);
    }
    tree_max[v] = max(tree_max[2 * v], tree_max[2 * v + 1]);
  }
}
int n;
int max_l[MAXN], min_r[MAXN], max_run[MAXN];
vector<int> ans;
void go(int llerew, int rdeedf) {
  if (llerew > rdeedf) {
    return;
  }
  if (llerew == rdeedf) {
    ans.push_back(llerew);
    return;
  }
  int m = (max_l[llerew] == llerew
               ? llerew
               : max_tree(1, 0, n - 1, llerew + 1, max_l[llerew]));
  if (m >= min_r[llerew]) {
    printf("IMPOSSIBLE\n");
    exit(0);
  }
  go(llerew + 1, m);
  ans.push_back(llerew);
  go(m + 1, rdeedf);
}
int main() {
  int c;
  scanf("%d%d", &n, &c);
  for (int i = 0; i < n; ++i) {
    max_l[i] = i;
    min_r[i] = n;
    max_run[i] = i;
  }
  int a, b;
  for (int i = 0; i < c; ++i) {
    scanf("%d%d %s", &a, &b, str);
    a--, b--;
    if (b <= a) {
      printf("IMPOSSIBLE\n");
      return 0;
    }
    if (str[0] == 'L') {
      max_l[a] = max(max_l[a], b);
    } else {
      min_r[a] = min(min_r[a], b);
    }
    max_run[a] = max(max_run[a], b);
  }
  build_max(1, 0, n - 1, max_run);
  for (int i = n - 1; i >= 0; --i) {
    max_run[i] = max_tree(1, 0, n - 1, i, max_run[i]);
    update_max(1, 0, n - 1, i, max_run[i]);
  }
  go(0, n - 1);
  for (int i = 0; i < n; ++i) {
    printf("%d ", ans[i] + 1);
  }
  printf("\n");
  return 0;
}
