Code Submission Evaluation System Login

HIIT Open 2016

Start:2016-05-28 11:00:00
End:2016-05-28 16:00:00
 

Tasks | Messages | Scoreboard | Statistics


CSES - HIIT Open 2016 - Graph painting

Graph painting

Time limit:1.00 s
Memory limit:256 MB

You are given a simple, undirected graph that consists of $n$ nodes and $m$ edges.

Your task is to paint each node red or blue so that there are at least $\lfloor m/2 \rfloor$ edges such that their nodes have a different color.

Input

The first input line contains an integer $t$: the number of test cases. After this, there are $t$ test cases that are described as follows:

The first line contains two integers $n$ and $m$: the number of nodes and edges in the graph. The nodes are numbered $1,2,\ldots,n$.

After this, there are $m$ lines that describe the edges. Each line contains two integers $a$ and $b$. This means that there is an edge between nodes $a$ and $b$.

Output

For each test case, output a line that contains $n$ space separated characters that describe the colors of the nodes. Each character must be R (red) or B (blue).

There is always a solution, and you can output any valid solution.

Constraints
Example

Input:
3
2 1
1 2
4 4
1 2
2 3
3 4
1 4
5 3
1 2
1 3
1 4


Output:
R B
B B R B
R B B B B