If you can't remember which character corresponds to which rule, remember that "輪" contains a loop, and "切" doesn't!
--- Lavaloid
Grammy is a puzzle master. Today, she is playing a variant of "Wagiri" puzzle.
The puzzle consists of a simple connected graph with

vertices with some Chinese characters on it. Each edge has a "Lun" or "Qie" symbol on it.
The goal is to delete some of the edges to form a
connected subgraph (including all of the vertices) such that:
-
Each remaining edge with the character ``Lun'' on it must be on at least one cycle formed by the remaining edges.
-
Each remaining edge with the character ``Qie'' on it must not be on any cycle formed by the remaining edges.

For example, the picture on the left illustrates an unsolved puzzle, and the picture on the right shows a solution to the puzzle, in which the highlighted edges are chosen in the final subgraph.
Grammy wants to find a solution to the puzzle. Please help Grammy find a solution, or report that no solution exists.
输入描述:
The first line contains
integers
(
), denoting the number of vertices and the number of edges.
Each of the next
lines contains
integers
(
) and a string
(
"
","
"
), denoting that there is an edge between
and
, and the type of this edge is
.
It is guaranteed that the given graph is a simple connected graph, that is, there are no self-loops or multiple edges, and all vertices are directly or indirectly connected by edges.
输出描述:
If the solution does not exist, output "
" on a single line.
Otherwise, output "
" on the first line, then output a single integer
(
) on the second line, followed by
lines, each of which contains two integers
, denoting a remaining edge in your solution. If there are multiple solutions, output any.
示例1
输入
复制
4 5
1 2 Lun
1 3 Lun
1 4 Qie
2 3 Lun
3 4 Qie
示例2
输入
复制
4 5
1 2 Lun
1 3 Qie
1 4 Qie
2 3 Lun
3 4 Qie