During a previous OCPC KIT contest, we noticed that other universities do not know how to $$$5$$$ color planar graphs. Thus, to keep you practicing, we will today present you with another graph coloring problem. This one will be easier for sure.
You are given $$$n$$$ line segments in the plane. Colour them in red and blue such that no two segments of the same colour intersect, or state that this is impossible.
The first line contains a single integer $$$n$$$ ($$$1 \le n \le 10^5$$$).
Each of the next $$$n$$$ lines contains four integers $$$x_1$$$, $$$y_1$$$, $$$x_2$$$ and $$$y_2$$$ ($$$-10^6 \le x_1, y_1, x_2, y_2 \le 10^6$$$), indicating a line segment from $$$(x_1, y_1)$$$ to $$$(x_2, y_2)$$$.
It is guaranteed that no two points in the input have the same $$$x$$$ or $$$y$$$ coordinate, and that no two line segments in the input intersect in more than a single point.
The first line of the output should be either YES or NO, indicating whether there is a solution.
If the answer is YES, the second line should be a string of length $$$n$$$ consisting of the letters R and B, indicating the colour of each segment in the order they were given in the input.
30 0 2 101 8 9 710 9 5 1
YES RBR
37 0 2 101 8 9 710 9 5 1
NO
1-1000000 1000000 1000000 -1000000
YES R