#include <bits/stdc++.h>
using namespace std;
int n, m;
vector<pair<int, int> > ques[105];
int a[105][2];
int re[105][105];
bool sign[105][105];
int f(int i, int j) {
  if (i > j) return 1;
  if (i >= j) {
    if (ques[i].empty())
      return 1;
    else
      return 0;
  }
  if (sign[i][j]) return re[i][j];
  for (int k = i; k <= j; k++) {
    bool have = false;
    for (int t = 0; t < (int)ques[i].size(); t++) {
      if (ques[i][t].second == 0 &&
          (ques[i][t].first < i + 1 || ques[i][t].first > k)) {
        have = true;
        break;
      }
      if (ques[i][t].second == 1 &&
          (ques[i][t].first < k + 1 || ques[i][t].first > j)) {
        have = true;
        break;
      }
    }
    if (!have) re[i][j] |= (f(i + 1, k) & f(k + 1, j));
  }
  sign[i][j] = true;
  return re[i][j];
}
void g(int i, int j) {
  if (i >= j) return;
  for (int k = i; k <= j; k++) {
    bool have = false;
    for (int t = 0; t < (int)ques[i].size(); t++) {
      if (ques[i][t].second == 0 &&
          (ques[i][t].first < i + 1 || ques[i][t].first > k)) {
        have = true;
        break;
      }
      if (ques[i][t].second == 1 &&
          (ques[i][t].first < k + 1 || ques[i][t].first > j)) {
        have = true;
        break;
      }
    }
    if (have == false && (f(i + 1, k) & f(k + 1, j)) == 1) {
      if (i + 1 <= k) a[i][0] = i + 1;
      if (k + 1 <= j) a[i][1] = k + 1;
      g(i + 1, k);
      g(k + 1, j);
      return;
    }
  }
}
void dfs(int u) {
  if (a[u][0] != -1) dfs(a[u][0]);
  printf("%d ", u);
  if (a[u][1] != -1) dfs(a[u][1]);
}
int main() {
  scanf("%d%d", &n, &m);
  for (int i = 1; i <= m; i++) {
    char str[6];
    int first, second;
    scanf("%d%d%s", &first, &second, str);
    if (first >= second) {
      printf("IMPOSSIBLE\n");
      return 0;
    }
    if (str[0] == 'L')
      ques[first].push_back(pair<int, int>(second, 0));
    else
      ques[first].push_back(pair<int, int>(second, 1));
  }
  if (f(1, n) == 0)
    printf("IMPOSSIBLE\n");
  else {
    memset(a, -1, sizeof a);
    g(1, n);
    dfs(1);
    printf("\n");
  }
  return 0;
}
