#include <bits/stdc++.h>
using namespace std;
int n, c;
vector<vector<pair<int, bool> > > constr;
int pos[100][100][100];
int can(int i, int j, int k) {
  if (pos[i][j][k] != -1) return pos[i][j][k];
  for (int l = 0; l < constr[i].size(); ++l) {
    int nxt = constr[i][l].first;
    bool dir = constr[i][l].second;
    if (dir == false && (j == i || nxt < i + 1 || nxt > j)) {
      pos[i][j][k] = 0;
      return false;
    }
    if (dir == true && (j == k || nxt < j + 1 || nxt > k)) {
      pos[i][j][k] = 0;
      return false;
    }
  }
  bool left = false, right = false;
  if (i != j) {
    for (int l = i + 1; l <= j; ++l) {
      if (can(i + 1, l, j)) {
        left = true;
        break;
      }
    }
  } else
    left = true;
  if (k != j) {
    for (int l = j + 1; l <= k; ++l) {
      if (can(j + 1, l, k)) {
        right = true;
        break;
      }
    }
  } else
    right = true;
  if (left && right)
    pos[i][j][k] = 1;
  else
    pos[i][j][k] = 0;
  return pos[i][j][k];
}
void make(int i, int j, int k) {
  if (i != j) {
    for (int l = i + 1; l <= j; ++l) {
      if (can(i + 1, l, j)) {
        make(i + 1, l, j);
        break;
      }
    }
  }
  cout << i + 1 << " ";
  if (k != j) {
    for (int l = j + 1; l <= k; ++l) {
      if (can(j + 1, l, k)) {
        make(j + 1, l, k);
        break;
      }
    }
  }
}
int main() {
  ios_base::sync_with_stdio(false);
  cin >> n >> c;
  constr.resize(n);
  for (int i = 0; i < c; ++i) {
    int a, b;
    string s;
    cin >> a >> b >> s;
    if (a >= b) {
      cout << "IMPOSSIBLE";
      return 0;
    }
    --a, --b;
    bool dir = (s == "LEFT") ? false : true;
    constr[a].push_back(make_pair(b, dir));
  }
  memset(pos, -1, 100 * 100 * 100 * sizeof(int));
  for (int i = 0; i < n; ++i) {
    if (can(0, i, n - 1)) {
      make(0, i, n - 1);
      return 0;
    }
  }
  cout << "IMPOSSIBLE";
  return 0;
}
