#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000005;
int N, K, L[MAXN][2], R[MAXN][2];
int main() {
  cin >> N >> K;
  for (int i = 0; i < N; i++) {
    L[i][1] = N;
  }
  for (int i = 0; i < K; i++) {
    int a, b;
    string s;
    cin >> a >> b >> s;
    if (a >= b) {
      cout << "IMPOSSIBLE\n";
      return 0;
    }
    a--, b--;
    if (s == "LEFT") {
      L[a][0] = max(L[a][0], b);
    } else {
      L[a][1] = min(L[a][1], b - 1);
      R[a][0] = max(R[a][0], b);
    }
  }
  for (int i = N - 1; i >= 0; i--) {
    for (int j = i + 1; j <= L[i][0]; j++) {
      L[i][0] = max(L[i][0], R[j][0]);
    }
    R[i][0] = max(R[i][0], L[i][0]);
    if (L[i][0] > L[i][1]) {
      cout << "IMPOSSIBLE\n";
      return 0;
    }
  }
  vector<int> V;
  for (int i = 0; i < N; i++) {
    V.push_back(i);
    while (V.size() && i >= L[V.back()][0]) {
      cout << V.back() + 1 << " ";
      V.pop_back();
    }
  }
  cout << '\n';
}
