Problem: You need to find a binary tree of size n that satisfies a given set of c constraints. Suppose that the nodes of the unknown binary tree are labeled using a pre-order traversal starting with 1. For the i-th constraint you are given two labels, ai and bi and a direction, left or right. In case of left direction, bi is an element of the subtree rooted at ai's left child. Similarly in the case of right direction bi is an element of the subtree rooted at ai's right child.

Input

The first line of input contains two integers n and c. The next c lines contain 2 integers ai, bi (1 ≤ ai, bi ≤ n) and either "LEFT" or "RIGHT" denoting whether b is in the subtree rooted at ai's left child or in the subtree rooted at ai's right child.

The problem consists of multiple subproblems. The subproblems have different constraints on the input. You will get some score for the correct submission of the subproblem. The description of the subproblems follows.

  * In subproblem D1 (9 points), the constraints 1 ≤ n ≤ 100, 1 ≤ c ≤ 50 will hold. 
  * In subproblem D2 (8 points), the constraints 1 ≤ n ≤ 1000000, 1 ≤ c ≤ 100000 will hold. 

Output

Output will be on a single line.

Any binary tree that satisfies the constraints will be accepted. The tree's nodes should be printed out as n space separated labels representing an in-order traversal, using the pre-order numbers as labels of vertices.

If there are no trees that satisfy the constraints, print "IMPOSSIBLE" (without quotes).

Examples

Input

3 2
1 2 LEFT
1 3 RIGHT


Output

2 1 3


Input

3 2
1 2 RIGHT
1 3 LEFT


Output

IMPOSSIBLE

Note

Consider the first sample test. We need to find a tree with 3 nodes that satisfies the following two constraints. The node labeled 2 with pre-order traversal should be in the left subtree of the node labeled 1 with pre-order traversal; the node labeled 3 with pre-order traversal should be in the right subtree of the node labeled 1. There is only one tree with three nodes that satisfies these constraints and its in-order traversal is (2, 1, 3).

Pre-order is the "root – left subtree – right subtree" order. In-order is the "left subtree – root – right subtree" order.

For other information regarding in-order and pre-order, see <http://en.wikipedia.org/wiki/Tree_traversal>.

Solution (in CPP):

Solution:
#include <bits/stdc++.h>
using namespace std;
int dx4[] = {-1, 0, 1, 0};
int dy4[] = {0, 1, 0, -1};
int dx8[] = {-1, -1, 0, 1, 1, 1, 0, -1};
int dy8[] = {0, 1, 1, 1, 0, -1, -1, -1};
void Duxar(int _this_line) {}
bool AreEqual(double a, double b) { return (fabs(a - b) < 1e-10); }
template <class T>
bool GetNr(T &_value) {
  T _sign = 1;
  char ch;
  _value = 0;
  while (!isdigit(ch = getchar())) {
    if (ch == -1) {
      return false;
    }
    ch == '-' ? _sign = -1 : _sign = 1;
  }
  do {
    _value = _value * 10 + (ch - '0');
  } while (isdigit(ch = getchar()));
  _value *= _sign;
  return true;
}
template <class T>
void PutNr(T _value, char _ch = ' ') {
  cout << _value << _ch;
}
int N, K;
vector<int> max_left, max_right, min_right, ans;
int Solve(int root, int last_mandatory, int first_bad) {
  if (last_mandatory < max_right[root]) {
    last_mandatory = max_right[root];
  }
  if (last_mandatory >= first_bad) {
    return 0;
  }
  int last_used = root;
  if (max_left[root]) {
    last_used = Solve(root + 1, max_left[root],
                      min_right[root] != 1 + N ? min_right[root] : first_bad);
  }
  if (!last_used) {
    return 0;
  }
  ans.push_back(root);
  if (last_mandatory >= last_used + 1) {
    return Solve(last_used + 1, last_mandatory, first_bad);
  } else {
    return last_used;
  }
}
int main() {
  string fileInput = "sum";
  int i, x, y;
  string way;
  GetNr(N);
  GetNr(K);
  max_left.resize(1 + N);
  max_right.resize(1 + N);
  min_right.resize(1 + N, 1 + N);
  for (i = 0; i < K; ++i) {
    GetNr(x);
    GetNr(y);
    cin >> way;
    if (x >= y) {
      PutNr("IMPOSSIBLE", '\n');
      return 0;
    }
    if (way == "LEFT") {
      max_left[x] = max(max_left[x], y);
    } else {
      min_right[x] = min(min_right[x], y);
      max_right[x] = max(max_right[x], y);
    }
    if (min_right[x] && max_left[x] > min_right[x]) {
      PutNr("IMPOSSIBLE", '\n');
      return 0;
    }
  }
  if (!Solve(1, N, 1 + N)) {
    PutNr("IMPOSSIBLE", '\n');
    return 0;
  } else {
    for (auto x : ans) {
      PutNr(x);
    }
    putchar('\n');
  }
  return 0;
}