#include <bits/stdc++.h>
using namespace std;
const int inf = 1e9;
const double eps = 1e-9;
const int INF = inf;
const double EPS = eps;
struct __timestamper {};
vector<vector<pair<int, int>>> rs;
vector<vector<vector<int>>> mem;
vector<int> solve(int l, int r) {
  if (l > r) return {};
  vector<int> &ans = mem[l][r];
  if (!ans.empty()) return ans;
  int maxL = l, minR = r + 1;
  for (pair<int, int> re : rs[l]) {
    if (!(l < re.first && re.first <= r)) return ans = {-1};
    if (re.second == 0)
      maxL = max(maxL, re.first);
    else
      minR = min(minR, re.first);
  }
  for (int firR = maxL + 1; firR <= minR; firR++) {
    vector<int> vl = solve(l + 1, firR - 1);
    if (!vl.empty() && vl[0] < 0) continue;
    vector<int> vr = solve(firR, r);
    if (!vr.empty() && vr[0] < 0) continue;
    vector<int> res;
    res.insert(res.end(), vl.begin(), vl.end());
    res.push_back(l);
    res.insert(res.end(), vr.begin(), vr.end());
    return ans = res;
  }
  return ans = {-1};
}
int main() {
  int n, m;
  while (scanf("%d%d", &n, &m) == 2) {
    rs = vector<vector<pair<int, int>>>(n);
    for (int i = 0; i < (m); i++) {
      int a, b;
      char ty[10];
      scanf("%d%d%s", &a, &b, ty), a--, b--;
      rs[a].push_back(make_pair(b, !strcmp(ty, "LEFT") ? 0 : 1));
    }
    mem = vector<vector<vector<int>>>(n, vector<vector<int>>(n));
    vector<int> ans = solve(0, n - 1);
    if (ans[0] < 0) {
      printf("IMPOSSIBLE\n");
    } else {
      for (int i = 0; i < (n); i++)
        printf("%d%c", ans[i] + 1, "\n "[i + 1 < n]);
    }
  }
  return 0;
}
