#include <bits/stdc++.h>
using namespace std;
int n, c, a, b;
vector<int> L[1000007];
vector<int> R[1000007];
vector<int> TL[1000007];
vector<int> TR[1000007];
int Lans[1000007];
int Rans[1000007];
int max_l[1000007];
int min_r[1000007];
int max_v[1000007];
int min_v[1000007];
string s;
void dfs(int v) {
  max_l[v] = -1000000007;
  min_r[v] = 1000000007;
  max_v[v] = min_v[v] = v;
  for (auto it : L[v]) {
    dfs(it);
    max_l[v] = max(max_l[v], max_v[it]);
    min_v[v] = min(min_v[v], min_v[it]);
  }
  for (auto it : R[v]) {
    dfs(it);
    min_r[v] = min(min_r[v], min_v[it]);
    min_v[v] = min(min_v[v], min_v[it]);
  }
}
int znajdz(int a, int b, int l, int r) {
  int Max = -1, Min = 1000000007;
  for (int i = min(a, l), j = max(b, r + 1); i <= r && j >= l + 1; ++i, --j) {
    if (i >= a) {
      for (auto it : R[i]) {
        Max = max(Max, it);
      }
      for (auto it : L[i]) {
        Max = max(Max, it);
      }
    }
    if (j <= b) {
      for (auto it : TR[j]) {
        if (it >= a) Min = min(Min, it);
      }
      for (auto it : TL[j]) {
        if (it >= a) Min = min(Min, it);
      }
    }
    if (i >= l && Max <= i) return i;
    if (j <= r + 1 && Min >= j) return j - 1;
  }
  cerr << a << " " << b << " " << l << " " << r << '\n';
  return -1;
}
bool build(int v, int a, int b) {
  max_l[v] = max(max_l[v], a);
  min_r[v] = min(min_r[v], b + 1);
  if (a == b) return 1;
  if (max_l[v] > min_r[v]) return 0;
  int k = znajdz(a + 1, b, max_l[v], min_r[v] - 1);
  if (k == -1)
    return 0;
  else {
    if (a + 1 <= k) {
      Lans[v] = a + 1;
      if (!build(a + 1, a + 1, k)) return 0;
    }
    if (k + 1 <= b) {
      Rans[v] = k + 1;
      if (!build(k + 1, k + 1, b)) return 0;
    }
    return 1;
  }
}
void read(int v) {
  if (Lans[v]) read(Lans[v]);
  cout << v << " ";
  if (Rans[v]) read(Rans[v]);
}
int32_t main() {
  ios_base::sync_with_stdio(0);
  cin.tie(NULL);
  cin >> n >> c;
  while (c--) {
    cin >> a >> b >> s;
    if (a >= b) {
      cout << "IMPOSSIBLE";
      return 0;
    }
    if (s[0] == 'R') {
      R[a].push_back(b);
      TR[b].push_back(a);
    } else {
      L[a].push_back(b);
      TL[b].push_back(a);
    }
  }
  for (int i = 1; i <= n; ++i) {
    sort((L[i]).begin(), (L[i]).end());
    L[i].erase(unique((L[i]).begin(), (L[i]).end()), L[i].end());
    sort((R[i]).begin(), (R[i]).end());
    R[i].erase(unique((R[i]).begin(), (R[i]).end()), R[i].end());
    sort((TL[i]).begin(), (TL[i]).end());
    TL[i].erase(unique((TL[i]).begin(), (TL[i]).end()), TL[i].end());
    sort((TR[i]).begin(), (TR[i]).end());
    TR[i].erase(unique((TR[i]).begin(), (TR[i]).end()), TR[i].end());
  }
  for (int i = 1; i <= n; ++i) {
    if (!min_v[i]) dfs(i);
  }
  if (!build(1, 1, n)) {
    cout << "IMPOSSIBLE";
    return 0;
  }
  read(1);
}
