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;
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;
}