#include <bits/stdc++.h>
using namespace std;
const int inf = (int)1e9;
const double eps = (double)1e-8;
const int mod = (int)1000000007;
const int maxn = (int)1e6 + 5;
int n, m, fl, b[maxn][2];
vector<int> a[maxn][2];
pair<int, int> c[maxn];
string type[maxn];
int dzen(int v, int l, int r) {
  if (v > l) {
    fl = 0;
    return 0;
  }
  if (l == v) l++;
  int ll, lr, rl, rr, st;
  ll = inf;
  lr = 0;
  rl = inf;
  rr = 0;
  for (int i = (0); i < (a[v][0].size()); i++) {
    ll = min(ll, a[v][0][i]);
    lr = max(lr, a[v][0][i]);
  }
  if (ll != inf) {
    b[v][0] = v + 1;
    st = dzen(v + 1, min(ll, l), lr) + 1;
  } else {
    st = v + 1;
  }
  if (!fl) return r;
  for (int i = (0); i < (a[v][1].size()); i++) {
    rl = min(rl, a[v][1][i]);
    rr = max(rr, a[v][1][i]);
  }
  if (rl == inf && st > r) {
    return st - 1;
  }
  b[v][1] = st;
  return dzen(st, min(st, rl), max(rr, r));
}
void glen(int v) {
  if (v == 0) return;
  glen(b[v][0]);
  cout << v << " ";
  glen(b[v][1]);
  return;
}
int main() {
  ios_base::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
  cin >> n;
  cin >> m;
  for (int i = (1); i <= (m); i++) {
    cin >> c[i].first >> c[i].second >> type[i];
    a[c[i].first][type[i] == "RIGHT"].push_back(c[i].second);
  }
  fl = 1;
  dzen(1, 1, n);
  if (!fl) {
    cout << "IMPOSSIBLE";
    return 0;
  }
  glen(1);
  return 0;
}
