#include <bits/stdc++.h>
using namespace std;
int n, c;
string S;
const int N = 1e6 + 5, INF = 1e7;
vector<pair<int, int> > tree;
vector<pair<int, int> > cons[N];
int maxLeft[N], maxRight[N], minLeft[N], minRight[N];
int vals[N];
bool okay;
int pre[N];
int segTree[N * 4];
int query(int cur, int cL, int cR, int l, int r) {
  if (cL > r || cR < l) {
    return 0;
  }
  if (cL >= l && cR <= r) {
    return segTree[cur];
  }
  int mid = (cL + cR) / 2;
  return max(query(cur * 2, cL, mid, l, r),
             query(cur * 2 + 1, mid + 1, cR, l, r));
}
void update(int cur, int cL, int cR, int p, int val) {
  if (p == cL && p == cR) {
    segTree[cur] = val;
    return;
  }
  if (cL > p || cR < p) {
    return;
  }
  int mid = (cL + cR) / 2;
  update(cur * 2, cL, mid, p, val);
  update(cur * 2 + 1, mid + 1, cR, p, val);
  segTree[cur] = max(segTree[cur * 2], segTree[cur * 2 + 1]);
}
void init() {
  pre[n] = n;
  for (int i = n - 1; i >= 1; i--) {
    int q = query(1, 1, n, i, maxLeft[i]);
    pre[i] = q;
    q = query(1, 1, n, i, max(maxRight[i], maxLeft[i]));
    update(1, 1, n, i, q);
  }
}
int solve(int s, int e) {
  if (s > e) {
    return -1;
  }
  int myIdx = tree.size();
  tree.push_back(pair<int, int>(-1, -1));
  vals[myIdx] = s;
  if (s == e) {
    okay &= cons[s].size() == 0;
    return myIdx;
  }
  int lastLeft = pre[s];
  if (minLeft[s] < s) {
    okay = false;
    return myIdx;
  }
  if (maxLeft[s] > e) {
    okay = false;
    return myIdx;
  }
  int startRight = lastLeft + 1;
  if (minRight[s] < startRight) {
    okay = false;
    return myIdx;
  }
  if (maxRight[s] > e) {
    okay = false;
    return myIdx;
  }
  int left = solve(s + 1, lastLeft);
  int right = solve(startRight, e);
  tree[myIdx].first = left;
  tree[myIdx].second = right;
  return myIdx;
}
void inorder(int cur) {
  if (cur == -1) return;
  inorder(tree[cur].first);
  cout << vals[cur] << " ";
  inorder(tree[cur].second);
}
int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  tree.push_back(pair<int, int>(-1, -1));
  cin >> n >> c;
  int a, b;
  for (int i = 1; i < N; i++) {
    minLeft[i] = minRight[i] = INF;
    maxLeft[i] = maxRight[i] = i;
    update(1, 1, n, i, i);
  }
  for (int i = 0; i < c; i++) {
    cin >> a >> b >> S;
    cons[a].push_back(pair<int, int>(b, S == "RIGHT"));
    if (S == "RIGHT") {
      maxRight[a] = max(maxRight[a], b);
      minRight[a] = min(minRight[a], b);
    } else {
      maxLeft[a] = max(maxLeft[a], b);
      minLeft[a] = min(minLeft[a], b);
    }
  }
  okay = true;
  init();
  solve(1, n);
  if (!okay) {
    cout << "IMPOSSIBLE" << endl;
  } else {
    inorder(1);
  }
  return 0;
}
