CF547D.Mike and Fish

普及/提高-

通过率:0%

AC君温馨提醒

该题目为【codeforces】题库的题目,您提交的代码将被提交至codeforces进行远程评测,并由ACGO抓取测评结果后进行展示。由于远程测评的测评机由其他平台提供,我们无法保证该服务的稳定性,若提交后无反应,请等待一段时间后再进行重试。

题目描述

As everyone knows, bears love fish. But Mike is a strange bear; He hates fish! The even more strange thing about him is he has an infinite number of blue and red fish.

He has marked nn distinct points in the plane. ii -th point is point (xi,yi)(x_{i},y_{i}) . He wants to put exactly one fish in each of these points such that the difference between the number of red fish and the blue fish on each horizontal or vertical line is at most 1.

He can't find a way to perform that! Please help him.

输入格式

The first line of input contains integer nn ( 1<=n<=2×1051<=n<=2×10^{5} ).

The next nn lines contain the information about the points, ii -th line contains two integers xix_{i} and yiy_{i} ( 1<=xi,yi<=2×1051<=x_{i},y_{i}<=2×10^{5} ), the ii -th point coordinates.

It is guaranteed that there is at least one valid answer.

输出格式

Print the answer as a sequence of nn characters 'r' (for red) or 'b' (for blue) where ii -th character denotes the color of the fish in the ii -th point.

输入输出样例

  • 输入#1

    4
    1 1
    1 2
    2 1
    2 2
    

    输出#1

    brrb
    
  • 输入#2

    3
    1 1
    1 2
    2 1
    

    输出#2

    brr
    
首页