#include <bits/stdc++.h>
using namespace std;
#pragma comment(linker, "/STACK:16777216")
template <class T>
T sqr(const T& t) {
  return t * t;
}
template <class T>
T abs(const T& t) {
  return ((t > 0) ? (t) : (-t));
}
void initialize() {
  freopen("_.in", "r", stdin);
  freopen("_.out", "w", stdout);
}
const int MAX = 100 + 5;
vector<pair<int, int> > restrictions[MAX];
int leftBound[MAX], rightBound[MAX];
vector<int> solution[MAX][MAX];
bool computed[MAX][MAX];
bool hasSolution[MAX][MAX];
bool solve(int left, int right) {
  if (computed[left][right]) {
    return hasSolution[left][right];
  }
  if (right == left + 1) {
    computed[left][right] = true;
    solution[left][right] = vector<int>(1, left);
    hasSolution[left][right] = true;
    return true;
  }
  if (right == left) {
    computed[left][right] = true;
    solution[left][right] = vector<int>(0);
    hasSolution[left][right] = true;
    return true;
  }
  vector<bool> busy(right - left, false);
  for (int i = left + 1; i < right; ++i) {
    for (int j = 0; j < restrictions[i].size(); ++j) {
      for (int k = i + 1; k <= restrictions[i][j].first; ++k) {
        busy[k - left - 1] = true;
      }
    }
  }
  bool found = false;
  for (int med = leftBound[left]; med <= min(right, rightBound[left]); ++med) {
    assert(med - left - 1 >= 0);
    if (busy[med - left - 1]) {
      continue;
    }
    if (solve(left + 1, med) && solve(med, right)) {
      found = true;
      solution[left][right] = solution[left + 1][med];
      solution[left][right].push_back(left);
      for (int i = 0; i < solution[med][right].size(); ++i) {
        solution[left][right].push_back(solution[med][right][i]);
      }
      break;
    }
  }
  computed[left][right] = true;
  hasSolution[left][right] = found;
  return found;
}
int main() {
  bool ok = true;
  int n, c;
  cin >> n >> c;
  for (int i = 0; i < c; ++i) {
    int a, b;
    string word;
    cin >> a >> b >> word;
    a -= 1;
    b -= 1;
    restrictions[a].push_back(pair<int, int>(b, word == "RIGHT"));
    if (a >= b) {
      ok = false;
    }
  }
  for (int i = 0; i < n; ++i) {
    sort(restrictions[i].begin(), restrictions[i].end());
    int rightestLeft = i;
    int leftestRight = n;
    for (int j = 0; j < restrictions[i].size(); ++j) {
      if (restrictions[i][j].second == 0) {
        rightestLeft = max(rightestLeft, restrictions[i][j].first);
      } else {
        leftestRight = min(leftestRight, restrictions[i][j].first);
      }
    }
    if (leftestRight <= rightestLeft) {
      ok = false;
    }
    leftBound[i] = rightestLeft + 1;
    rightBound[i] = leftestRight;
  }
  if (ok) {
    ok = solve(0, n);
  }
  if (!ok) {
    cout << "IMPOSSIBLE" << endl;
  } else {
    for (int i = 0; i < n; ++i) {
      cout << solution[0][n][i] + 1 << ((i + 1 == n) ? '\n' : ' ');
    }
  }
  return 0;
}
