#include <bits/stdc++.h>
using namespace std;
const int MAX_N = 1000005;
const int INF = 1000000000;
struct SegmentTree {
  int offset;
  vector<int> v;
  void initialize(int n, int a[]) {
    for (offset = 1; offset < n; offset <<= 1)
      ;
    v.resize(2 * offset, -INF);
    for (int i = 0; i < n; i++) {
      v[offset + i] = a[i];
    }
    for (int i = offset - 1; i > 0; i--) {
      v[i] = max(v[i * 2], v[i * 2 + 1]);
    }
  }
  int query(int x, int lo, int hi, int a, int b) {
    if (lo >= b || hi <= a) {
      return -INF;
    } else if (lo >= a && hi <= b) {
      return v[x];
    }
    return max(query(x * 2, lo, (lo + hi) / 2, a, b),
               query(x * 2 + 1, (lo + hi) / 2, hi, a, b));
  }
  int query(int a, int b) {
    if (a > b) {
      return -INF;
    }
    return query(1, 0, offset, a, b + 1);
  }
};
int n, c, xy[MAX_N][2], son[MAX_N];
int e[MAX_N][2];
SegmentTree sson;
vector<int> l[MAX_N], r[MAX_N];
void solve(int x, int y) {
  if (x >= y) {
    return;
  }
  if (xy[x][0] == x) {
    e[x][1] = x + 1;
    for (int i = 0; i < r[x].size(); i++) {
      if (r[x][i] < x + 1 || r[x][i] > y) {
        printf("IMPOSSIBLE\n");
        exit(0);
      }
    }
    solve(x + 1, y);
  } else if (xy[x][1] == n) {
    e[x][0] = x + 1;
    for (int i = 0; i < l[x].size(); i++) {
      if (l[x][i] < x + 1 || l[x][i] > y) {
        printf("IMPOSSIBLE\n");
        exit(0);
      }
    }
    solve(x + 1, y);
  } else {
    int a, m = 0;
    for (a = x + 1; a < y; a++) {
      m = max(m, son[a]);
      if (a >= xy[x][0] && m == a) {
        break;
      }
    }
    if (a >= y) {
      printf("IMPOSSIBLE\n");
      exit(0);
    }
    e[x][0] = x + 1;
    e[x][1] = a + 1;
    for (int i = 0; i < l[x].size(); i++) {
      if (l[x][i] < x + 1 || l[x][i] > a) {
        printf("IMPOSSIBLE\n");
        exit(0);
      }
    }
    for (int i = 0; i < r[x].size(); i++) {
      if (r[x][i] < a + 1 || r[x][i] > y) {
        printf("IMPOSSIBLE\n");
        exit(0);
      }
    }
    solve(x + 1, a);
    solve(a + 1, y);
  }
}
void print(int u) {
  if (u < 0 || u >= n) {
    return;
  }
  print(e[u][0]);
  printf("%d ", u + 1);
  print(e[u][1]);
}
int main() {
  scanf("%d %d", &n, &c);
  for (int i = 0; i < n; i++) {
    son[i] = i;
  }
  for (int i = 0; i < c; i++) {
    int u, v;
    char dir[10];
    scanf("%d %d %s", &u, &v, dir);
    --u, --v;
    son[u] = max(son[u], v);
    if (dir[0] == 'L') {
      l[u].push_back(v);
    } else {
      r[u].push_back(v);
    }
  }
  sson.initialize(n, son);
  for (int i = 0; i < n; i++) {
    sort(l[i].begin(), l[i].end());
    sort(r[i].begin(), r[i].end());
    int d = 0;
    for (int j = 0; j < l[i].size(); j++) {
      while (d < r[i].size() && r[i][d] < l[i][j]) {
        d++;
      }
      if (d < r[i].size() && r[i][d] == l[i][j]) {
        printf("IMPOSSIBLE\n");
        return 0;
      }
    }
    if (!l[i].empty() && (*l[i].begin()) <= i) {
      printf("IMPOSSIBLE\n");
      return 0;
    }
    if (!r[i].empty() && (*r[i].begin()) <= i) {
      printf("IMPOSSIBLE\n");
      return 0;
    }
    if (!l[i].empty() && !r[i].empty() && (*l[i].rbegin()) > (*r[i].begin())) {
      printf("IMPOSSIBLE\n");
      return 0;
    }
    if (l[i].empty()) {
      xy[i][0] = i;
    } else {
      xy[i][0] = (*l[i].rbegin());
    }
    if (r[i].empty()) {
      xy[i][1] = n;
    } else {
      xy[i][1] = (*r[i].begin());
    }
  }
  memset(e, -1, sizeof(e));
  solve(0, n - 1);
  print(0);
  printf("\n");
  return 0;
}
