#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000010;
int N, C;
int v = 1;
vector<int> cons[MAXN][2];
int ch[MAXN][2];
bool dfs(int n, int t) {
  for (int i = 0; i < 2; i++) {
    sort(cons[n][i].begin(), cons[n][i].end());
  }
  if (cons[n][0].size()) {
    int next = ++v;
    ch[n][0] = next;
    if (!dfs(next, cons[n][0].back())) return false;
  }
  if (cons[n][1].size() > 0 && v >= cons[n][1].front()) return false;
  if (cons[n][1].size()) t = max(t, cons[n][1].back());
  if (v < t) {
    int next = ++v;
    ch[n][1] = next;
    if (!dfs(next, t)) return false;
  }
  return true;
}
bool works() {
  for (int i = 0; i < C; i++) {
    int a, b;
    cin >> a >> b;
    if (a >= b) return false;
    string s;
    cin >> s;
    cons[a][s == "RIGHT"].push_back(b);
  }
  return dfs(1, N);
}
void printtree(int n) {
  if (n == 0) return;
  printtree(ch[n][0]);
  cout << n << " ";
  printtree(ch[n][1]);
}
int main() {
  cin >> N >> C;
  if (works()) {
    printtree(1);
    cout << endl;
  } else {
    cout << "IMPOSSIBLE\n";
  }
}
