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>
#pragma GCC optimize(3)
#pragma GCC optimize(2)
using namespace std;
typedef const int& ci;
struct edge_node {
  int v, nxt;
  edge_node() {}
  edge_node(ci _v, ci _nxt) : v(_v), nxt(_nxt) {}
};
struct tree {
  int head[1000000 + 1], cnt;
  edge_node edge[100000];
  void build() { memset(head, -1, sizeof(head)), cnt = -1; }
  void push(ci u, ci v) {
    edge[++cnt] = edge_node(v, head[u]);
    head[u] = cnt;
  }
};
tree ltr, rtr;
int mxl[1000000 + 1], mnr[1000000 + 1], mxr[1000000 + 1], mxn[1000000 + 1];
int ans[1000000 + 1], *now;
void solve(ci l, ci r) {
  if (l > r) return;
  if (mxl[l]) {
    solve(l + 1, mxl[l]);
    *++now = l;
    solve(mxl[l] + 1, r);
  } else {
    *++now = l;
    solve(l + 1, r);
  }
}
struct node {
  int val, pos;
  node() {}
  node(ci v, ci p) : val(v), pos(p) {}
};
template <typename _Tp>
_Tp* lower_bound_greater(_Tp* __first, _Tp* __last, const _Tp& __val) {
  for (_Tp* __middle;
       (__middle = __first + ((__last - __first) >> 1)) > __first;
       (*__middle >= __val ? __first : __last) = __middle)
    ;
  return __first;
}
int pos[1000000 + 1], val[1000000 + 1], *nps, *nvl;
template <typename T>
void read(T& x) {
  int ch;
  while (!isdigit(ch = getchar()))
    ;
  for (x = ch ^ '0'; isdigit(ch = getchar()); x = x * 10 + (ch ^ '0'))
    ;
}
template <typename T1, typename T2>
void read(T1& x, T2& y) {
  read(x);
  read(y);
}
template <typename T>
void write(const T& x) {
  if (x >= 10) write(x / 10);
  putchar((x % 10) | '0');
}
template <typename T>
void write(const T& x, const char& ch) {
  write(x);
  putchar(ch);
}
template <typename T>
void writeln(const T& x) {
  write(x, '\n');
}
int getalpha() {
  int ch;
  while (!isalpha(ch = getchar()))
    ;
  return ch;
}
int main() {
  int n, c;
  read(n, c), now = ans, ltr.build(), rtr.build();
  for (int i = c + 1, a, b; --i; (getalpha() == 'L' ? ltr : rtr).push(a, b)) {
    read(a, b);
    if (b <= a) {
      puts("IMPOSSIBLE");
      return 0;
    }
  }
  pos[0] = 2147483647, val[0] = 2147483647, mxl[n] = mxr[n],
  mnr[n] = 2147483647, mxn[n] = n, pos[1] = n, val[1] = n, nps = pos + 1,
  nvl = val + 1;
  for (int i = n; --i;) {
    int &mxli = mxl[i], &mxri = mxr[i], &mnri = mnr[i];
    mxli = mxri = 0, mnri = 2147483647;
    for (int j = ltr.head[i], tmp; ~j; j = ltr.edge[j].nxt)
      (tmp = mxn[ltr.edge[j].v]) > mxli && (mxli = tmp);
    mxli && (mxli = val[lower_bound_greater(pos + 1, nps + 1, mxli) - pos]);
    for (int j = rtr.head[i], tmp; ~j; j = rtr.edge[j].nxt) {
      (tmp = rtr.edge[j].v) < mnri && (mnr[i] = tmp);
      (tmp = mxn[tmp]) > mxri && (mxr[i] = tmp);
    }
    mxri && (mxri = val[lower_bound_greater(pos + 1, nps + 1, mxri) - pos]);
    int mxni = (mxn[i] = mxri ? mxri : (mxli ? mxli : i));
    for (; mxni > *nvl; --nvl, --nps)
      ;
    *++nps = i, *++nvl = mxni;
    if (mxli >= mnri) {
      puts("IMPOSSIBLE");
      return 0;
    }
  }
  solve(1, n);
  for (int* i = ans; ++i < now; write(*i, ' '))
    ;
  writeln(*now);
  return 0;
}