#include <bits/stdc++.h>
using namespace std;
int dx4[] = {-1, 0, 1, 0};
int dy4[] = {0, 1, 0, -1};
int dx8[] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dy8[] = {0, 1, 1, 1, 0, -1, -1, -1};
void Duxar(int _this_line) {}
bool AreEqual(double a, double b) { return (fabs(a - b) < 1e-10); }
template <class T>
bool GetNr(T &_value) {
  T _sign = 1;
  char ch;
  _value = 0;
  while (!isdigit(ch = getchar())) {
    if (ch == -1) {
      return false;
    }
    ch == '-' ? _sign = -1 : _sign = 1;
  }
  do {
    _value = _value * 10 + (ch - '0');
  } while (isdigit(ch = getchar()));
  _value *= _sign;
  return true;
}
template <class T>
void PutNr(T _value, char _ch = ' ') {
  cout << _value << _ch;
}
int N, K;
vector<int> max_left, max_right, min_right, ans;
int Solve(int root, int last_mandatory, int first_bad) {
  if (last_mandatory < max_right[root]) {
    last_mandatory = max_right[root];
  }
  if (last_mandatory >= first_bad) {
    return 0;
  }
  int last_used = root;
  if (max_left[root]) {
    last_used = Solve(root + 1, max_left[root],
                      min_right[root] != 1 + N ? min_right[root] : first_bad);
  }
  if (!last_used) {
    return 0;
  }
  ans.push_back(root);
  if (last_mandatory >= last_used + 1) {
    return Solve(last_used + 1, last_mandatory, first_bad);
  } else {
    return last_used;
  }
}
int main() {
  string fileInput = "sum";
  int i, x, y;
  string way;
  GetNr(N);
  GetNr(K);
  max_left.resize(1 + N);
  max_right.resize(1 + N);
  min_right.resize(1 + N, 1 + N);
  for (i = 0; i < K; ++i) {
    GetNr(x);
    GetNr(y);
    cin >> way;
    if (x >= y) {
      PutNr("IMPOSSIBLE", '\n');
      return 0;
    }
    if (way == "LEFT") {
      max_left[x] = max(max_left[x], y);
    } else {
      min_right[x] = min(min_right[x], y);
      max_right[x] = max(max_right[x], y);
    }
    if (min_right[x] && max_left[x] > min_right[x]) {
      PutNr("IMPOSSIBLE", '\n');
      return 0;
    }
  }
  if (!Solve(1, N, 1 + N)) {
    PutNr("IMPOSSIBLE", '\n');
    return 0;
  } else {
    for (auto x : ans) {
      PutNr(x);
    }
    putchar('\n');
  }
  return 0;
}
