#include <bits/stdc++.h>
using namespace std;
const int N = 1111111;
int n, m, nodes;
int node[N][2];
vector<int> l[N], r[N];
inline void print(int x) {
  if (node[x][0]) {
    print(node[x][0]);
  }
  printf("%d ", x);
  if (node[x][1]) {
    print(node[x][1]);
  }
}
void dfs(int x, int maximum) {
  {
    int num = x;
    for (int i = 0; i < (int)l[x].size(); ++i) {
      int y = l[x][i];
      if (y <= nodes) {
        throw -1;
      }
      num = max(num, y);
    }
    if (num > x) {
      nodes++;
      node[x][0] = nodes;
      dfs(nodes, num);
    }
  }
  {
    int num = x;
    for (int i = 0; i < (int)r[x].size(); ++i) {
      int y = r[x][i];
      if (y <= nodes) {
        throw -1;
      }
      num = max(num, y);
    }
    num = max(maximum, num);
    if (num > nodes) {
      nodes++;
      node[x][1] = nodes;
      dfs(nodes, num);
    }
  }
}
int main() {
  try {
    scanf("%d%d", &n, &m);
    for (int i = 1; i <= m; ++i) {
      int a, b;
      static char buffer[111];
      scanf("%d%d%s", &a, &b, buffer);
      if (b <= a) {
        throw -1;
      }
      if (buffer[0] == 'L') {
        l[a].push_back(b);
      } else {
        r[a].push_back(b);
      }
    }
    nodes = 1;
    dfs(1, n);
    print(1);
    puts("");
  } catch (int exception) {
    puts("IMPOSSIBLE");
  }
  return 0;
}
