#include <bits/stdc++.h>
using namespace std;
const long double pi = 3.1415926535897932384626433832795l;
template <typename T>
inline auto sqr(T x) -> decltype(x * x) {
  return x * x;
}
template <typename T>
inline T abs(T x) {
  return x > T() ? x : -x;
}
template <typename T1, typename T2>
inline bool umx(T1& a, T2 b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename T1, typename T2>
inline bool umn(T1& a, T2 b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
const int N = 1000100;
struct Input {
  int n, c;
  int tp[N];
  int a[N], b[N];
  bool read() {
    if (scanf("%d %d", &n, &c) != 2) return 0;
    for (int i = int(0); i < int(c); ++i) {
      scanf("%d %d ", &a[i], &b[i]);
      a[i]--, b[i]--;
      char c1;
      scanf("%c", &c1);
      tp[i] = (c1 == 'R');
      string qwe;
      getline(cin, qwe);
    }
    return 1;
  }
  void init(const Input& input) { *this = input; }
};
struct Data : Input {
  vector<int> ans;
  bool ok;
  void write() {
    if (ok) {
      for (int i = int(0); i < int(ans.size()); ++i) {
        printf("%d ", ans[i] + 1);
      }
    } else {
      puts("IMPOSSIBLE");
    }
  }
  virtual void solve() {}
  virtual void clear() { *this = Data(); }
};
struct Solution : Data {
  int l[N], r[N];
  int cnt;
  int tol[N], tor[N];
  vector<int> left[N], right[N];
  void dfs(int v, int mn, bool only) {
    if (l[v] > v && cnt < n) {
      cnt++;
      tol[v] = cnt - 1;
      dfs(cnt - 1, l[v], 0);
    }
    ans.push_back(v);
    umx(mn, r[v]);
    if (mn > cnt - 1 || (only && cnt < n)) {
      cnt++;
      tor[v] = cnt - 1;
      dfs(cnt - 1, mn, only);
    }
  }
  bool use[N];
  void dfs(int v) {
    use[v] = 1;
    ;
    for (int i = int(0); i < int(left[v].size()); ++i) {
      int to = left[v][i];
      if (use[to]) {
        ok = 0;
      }
    }
    if (tol[v] >= 0) {
      dfs(tol[v]);
    }
    for (int i = int(0); i < int(left[v].size()); ++i) {
      int to = left[v][i];
      if (!use[to]) {
        ok = 0;
      }
    }
    for (int i = int(0); i < int(right[v].size()); ++i) {
      int to = right[v][i];
      if (use[to]) {
        ok = 0;
      }
    };
    if (tor[v] >= 0) {
      dfs(tor[v]);
    }
    for (int i = int(0); i < int(right[v].size()); ++i) {
      int to = right[v][i];
      if (!use[to]) {
        ok = 0;
      }
    };
  }
  void solve() {
    memset(l, -1, sizeof(l));
    memset(r, -1, sizeof(r));
    memset(tol, -1, sizeof(tol));
    memset(tor, -1, sizeof(tor));
    for (int i = int(0); i < int(c); ++i) {
      if (a[i] > b[i]) {
        ok = 0;
        return;
      }
      if (tp[i]) {
        umx(r[a[i]], b[i]);
      } else {
        umx(l[a[i]], b[i]);
      }
    }
    cnt = 1;
    dfs(0, -1, 1);
    ok = 1;
    for (int i = int(0); i < int(c); ++i) {
      if (tp[i] == 0)
        left[a[i]].push_back(b[i]);
      else
        right[a[i]].push_back(b[i]);
    }
    dfs(0);
  }
  void clear() { *this = Solution(); }
};
Solution sol;
int main() {
  cout.setf(ios::showpoint | ios::fixed);
  cout.precision(20);
  sol.read();
  sol.solve();
  sol.write();
  return 0;
}
