import java.io.* ;
import java.util.* ;
public class TaskD {
private final InputReader reader;
private final OutputWriter writer;
public TaskD( InputReader reader, OutputWriter writer) {
this .reader = reader;
this .writer = writer;
}
public static void main
( String [ ] args
) { InputReader reader
= new InputReader
( System .
in ) ; OutputWriter writer
= new OutputWriter
( System .
out ) ; new TaskD( reader, writer) .run ( ) ;
writer.writer .flush ( ) ;
}
int [ ] col;
List< Integer> [ ] E;
int [ ] A, B;
int to( int e, int x) {
return A[ e] ^ B[ e] ^ x;
}
int [ ] ept;
void DFS( int x, int f) {
while ( ept[ x] != E[ x] .size ( ) && col[ E[ x] .get ( ept[ x] ) ] != - 1 )
ept[ x] ++;
if ( ept[ x] == E[ x] .size ( ) )
return ;
int e = E[ x] .get ( ept[ x] ++ ) ;
col[ e] = f;
DFS( to( e, x) , 1 - f) ;
}
public void run( ) {
int n = reader.nextInt ( ) ;
final int N = 200500 ;
for ( int i = 0 ; i < 3 * N; i++ )
E[ i] = new ArrayList< Integer> ( ) ;
int [ ] X = new int [ N] ;
int [ ] Y = new int [ N] ;
A = new int [ 3 * N] ;
B = new int [ 3 * N] ;
ept = new int [ 3 * N] ;
col = new int [ 3 * N] ;
for ( int i = 0 ; i < n; i++ ) {
X[ i] = reader.nextInt ( ) - 1 ;
Y[ i] = reader.nextInt ( ) - 1 ;
A[ i] = X[ i] ;
B[ i] = Y[ i] + N;
E[ X[ i] ] .add ( i) ;
E[ Y[ i] + N] .add ( i) ;
}
int pt = 2 * N;
int ppt = N;
int parity = 0 ;
boolean was = false ;
for ( int i = 0 ; i < 2 * N; i++ )
if ( E[ i] .size ( ) % 2 == 1 ) {
if ( parity == 1 && ppt > N && A[ ppt - 1 ] < N && i >= N && ! was) {
B[ ppt - 1 ] = i;
E[ i] .add ( ppt - 1 ) ;
parity = 0 ;
was = true ;
} else {
A[ ppt] = i;
B[ ppt] = pt;
E[ A[ ppt] ] .add ( ppt) ;
E[ B[ ppt] ] .add ( ppt) ;
ppt++;
if ( parity == 0 )
parity = 1 ;
else {
pt++;
parity = 0 ;
}
}
}
if ( parity == 1 )
throw new AssertionError( ) ;
for ( int i = 0 ; i < 2 * N; i++ ) {
DFS( i, 0 ) ;
}
char [ ] ans = new char [ n] ;
for ( int i = 0 ; i < n; i++ ) {
if ( col[ i] == - 1 )
throw new AssertionError( ) ;
ans[ i] = col[ i] == 1 ? 'r' : 'b' ;
}
writer.
printf ( "%s\n " ,
String .
valueOf ( ans
) ) ; }
static class InputReader {
tokenizer = null ;
}
while ( tokenizer == null || ! tokenizer.hasMoreTokens ( ) ) {
try {
}
}
return tokenizer.nextToken ( ) ;
}
public int nextInt( ) {
}
public double nextDouble( ) {
return Double .
parseDouble ( next
( ) ) ; }
public long nextLong( ) {
return Long .
parseLong ( next
( ) ) ; }
}
static class OutputWriter {
}
}
}
}
aW1wb3J0IGphdmEuaW8uKjsKaW1wb3J0IGphdmEudXRpbC4qOwoKcHVibGljIGNsYXNzIFRhc2tEIHsKICAgIHByaXZhdGUgZmluYWwgSW5wdXRSZWFkZXIgcmVhZGVyOwogICAgcHJpdmF0ZSBmaW5hbCBPdXRwdXRXcml0ZXIgd3JpdGVyOwoKICAgIHB1YmxpYyBUYXNrRChJbnB1dFJlYWRlciByZWFkZXIsIE91dHB1dFdyaXRlciB3cml0ZXIpIHsKICAgICAgICB0aGlzLnJlYWRlciA9IHJlYWRlcjsKICAgICAgICB0aGlzLndyaXRlciA9IHdyaXRlcjsKICAgIH0KCiAgICBwdWJsaWMgc3RhdGljIHZvaWQgbWFpbihTdHJpbmdbXSBhcmdzKSB7CiAgICAgICAgSW5wdXRSZWFkZXIgcmVhZGVyID0gbmV3IElucHV0UmVhZGVyKFN5c3RlbS5pbik7CiAgICAgICAgT3V0cHV0V3JpdGVyIHdyaXRlciA9IG5ldyBPdXRwdXRXcml0ZXIoU3lzdGVtLm91dCk7CiAgICAgICAgbmV3IFRhc2tEKHJlYWRlciwgd3JpdGVyKS5ydW4oKTsKICAgICAgICB3cml0ZXIud3JpdGVyLmZsdXNoKCk7CiAgICB9CgogICAgaW50W10gY29sOwogICAgTGlzdDxJbnRlZ2VyPltdIEU7CgogICAgaW50W10gQSwgQjsKICAgIGludCB0byhpbnQgZSwgaW50IHgpIHsKICAgICAgICByZXR1cm4gQVtlXSBeIEJbZV0gXiB4OwogICAgfQoKICAgIGludFtdIGVwdDsKICAgIHZvaWQgREZTKGludCB4LCBpbnQgZikgewogICAgICAgIHdoaWxlIChlcHRbeF0gIT0gRVt4XS5zaXplKCkgJiYgY29sW0VbeF0uZ2V0KGVwdFt4XSldICE9IC0xKQogICAgICAgICAgICBlcHRbeF0rKzsKICAgICAgICBpZiAoZXB0W3hdID09IEVbeF0uc2l6ZSgpKQogICAgICAgICAgICByZXR1cm47CiAgICAgICAgaW50IGUgPSBFW3hdLmdldChlcHRbeF0rKyk7CiAgICAgICAgY29sW2VdID0gZjsKICAgICAgICBERlModG8oZSwgeCksIDEgLSBmKTsKICAgIH0KCiAgICBwdWJsaWMgdm9pZCBydW4oKSB7CiAgICAgICAgaW50IG4gPSByZWFkZXIubmV4dEludCgpOwogICAgICAgIGZpbmFsIGludCBOID0gMjAwNTAwOwogICAgICAgIEUgPSBuZXcgTGlzdFszICogTl07CiAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCAzICogTjsgaSsrKQogICAgICAgICAgICBFW2ldID0gbmV3IEFycmF5TGlzdDxJbnRlZ2VyPigpOwogICAgICAgIGludFtdIFggPSBuZXcgaW50W05dOwogICAgICAgIGludFtdIFkgPSBuZXcgaW50W05dOwogICAgICAgIEEgPSBuZXcgaW50WzMgKiBOXTsKICAgICAgICBCID0gbmV3IGludFszICogTl07CiAgICAgICAgZXB0ID0gbmV3IGludFszICogTl07CiAgICAgICAgY29sID0gbmV3IGludFszICogTl07CiAgICAgICAgQXJyYXlzLmZpbGwoY29sLCAtMSk7CiAgICAgICAgZm9yIChpbnQgaSA9IDA7IGkgPCBuOyBpKyspIHsKICAgICAgICAgICAgWFtpXSA9IHJlYWRlci5uZXh0SW50KCkgLSAxOwogICAgICAgICAgICBZW2ldID0gcmVhZGVyLm5leHRJbnQoKSAtIDE7CiAgICAgICAgICAgIEFbaV0gPSBYW2ldOwogICAgICAgICAgICBCW2ldID0gWVtpXSArIE47CiAgICAgICAgICAgIEVbWFtpXV0uYWRkKGkpOwogICAgICAgICAgICBFW1lbaV0gKyBOXS5hZGQoaSk7CiAgICAgICAgfQogICAgICAgIGludCBwdCA9IDIgKiBOOwogICAgICAgIGludCBwcHQgPSBOOwogICAgICAgIGludCBwYXJpdHkgPSAwOwoKICAgICAgICBib29sZWFuIHdhcyA9IGZhbHNlOwogICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgMiAqIE47IGkrKykKICAgICAgICAgICAgaWYgKEVbaV0uc2l6ZSgpICUgMiA9PSAxKSB7CiAgICAgICAgICAgICAgICBpZiAocGFyaXR5ID09IDEgJiYgcHB0ID4gTiAmJiBBW3BwdCAtIDFdIDwgTiAmJiBpID49IE4gJiYgIXdhcykgewogICAgICAgICAgICAgICAgICAgIEJbcHB0IC0gMV0gPSBpOwogICAgICAgICAgICAgICAgICAgIEVbaV0uYWRkKHBwdCAtIDEpOwogICAgICAgICAgICAgICAgICAgIHBhcml0eSA9IDA7CiAgICAgICAgICAgICAgICAgICAgd2FzID0gdHJ1ZTsKICAgICAgICAgICAgICAgIH0gZWxzZSB7CiAgICAgICAgICAgICAgICAgICAgQVtwcHRdID0gaTsKICAgICAgICAgICAgICAgICAgICBCW3BwdF0gPSBwdDsKICAgICAgICAgICAgICAgICAgICBFW0FbcHB0XV0uYWRkKHBwdCk7CiAgICAgICAgICAgICAgICAgICAgRVtCW3BwdF1dLmFkZChwcHQpOwogICAgICAgICAgICAgICAgICAgIHBwdCsrOwogICAgICAgICAgICAgICAgICAgIGlmIChwYXJpdHkgPT0gMCkKICAgICAgICAgICAgICAgICAgICAgICAgcGFyaXR5ID0gMTsKICAgICAgICAgICAgICAgICAgICBlbHNlIHsKICAgICAgICAgICAgICAgICAgICAgICAgcHQrKzsKICAgICAgICAgICAgICAgICAgICAgICAgcGFyaXR5ID0gMDsKICAgICAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgICAgICB9CiAgICAgICAgICAgIH0KICAgICAgICBpZiAocGFyaXR5ID09IDEpCiAgICAgICAgICAgIHRocm93IG5ldyBBc3NlcnRpb25FcnJvcigpOwogICAgICAgIGZvciAoaW50IGkgPSAwOyBpIDwgMiAqIE47IGkrKykgewogICAgICAgICAgICBERlMoaSwgMCk7CiAgICAgICAgfQogICAgICAgIGNoYXJbXSBhbnMgPSBuZXcgY2hhcltuXTsKICAgICAgICBmb3IgKGludCBpID0gMDsgaSA8IG47IGkrKykgewogICAgICAgICAgICBpZiAoY29sW2ldID09IC0xKQogICAgICAgICAgICAgICAgdGhyb3cgbmV3IEFzc2VydGlvbkVycm9yKCk7CiAgICAgICAgICAgIGFuc1tpXSA9IGNvbFtpXSA9PSAxID8gJ3InIDogJ2InOwogICAgICAgIH0KICAgICAgICB3cml0ZXIucHJpbnRmKCIlc1xuIiwgU3RyaW5nLnZhbHVlT2YoYW5zKSk7CiAgICB9CgoKICAgIHN0YXRpYyBjbGFzcyBJbnB1dFJlYWRlciB7CiAgICAgICAgcHVibGljIEJ1ZmZlcmVkUmVhZGVyIHJlYWRlcjsKICAgICAgICBwdWJsaWMgU3RyaW5nVG9rZW5pemVyIHRva2VuaXplcjsKCiAgICAgICAgcHVibGljIElucHV0UmVhZGVyKElucHV0U3RyZWFtIHN0cmVhbSkgewogICAgICAgICAgICByZWFkZXIgPSBuZXcgQnVmZmVyZWRSZWFkZXIobmV3IElucHV0U3RyZWFtUmVhZGVyKHN0cmVhbSksIDMyNzY4KTsKICAgICAgICAgICAgdG9rZW5pemVyID0gbnVsbDsKICAgICAgICB9CgogICAgICAgIHB1YmxpYyBTdHJpbmcgbmV4dCgpIHsKICAgICAgICAgICAgd2hpbGUgKHRva2VuaXplciA9PSBudWxsIHx8ICF0b2tlbml6ZXIuaGFzTW9yZVRva2VucygpKSB7CiAgICAgICAgICAgICAgICB0cnkgewogICAgICAgICAgICAgICAgICAgIHRva2VuaXplciA9IG5ldyBTdHJpbmdUb2tlbml6ZXIocmVhZGVyLnJlYWRMaW5lKCkpOwogICAgICAgICAgICAgICAgfSBjYXRjaCAoSU9FeGNlcHRpb24gZSkgewogICAgICAgICAgICAgICAgICAgIHRocm93IG5ldyBSdW50aW1lRXhjZXB0aW9uKGUpOwogICAgICAgICAgICAgICAgfQogICAgICAgICAgICB9CiAgICAgICAgICAgIHJldHVybiB0b2tlbml6ZXIubmV4dFRva2VuKCk7CiAgICAgICAgfQoKICAgICAgICBwdWJsaWMgaW50IG5leHRJbnQoKSB7CiAgICAgICAgICAgIHJldHVybiBJbnRlZ2VyLnBhcnNlSW50KG5leHQoKSk7CiAgICAgICAgfQoKICAgICAgICBwdWJsaWMgZG91YmxlIG5leHREb3VibGUoKSB7CiAgICAgICAgICAgIHJldHVybiBEb3VibGUucGFyc2VEb3VibGUobmV4dCgpKTsKICAgICAgICB9CgogICAgICAgIHB1YmxpYyBsb25nIG5leHRMb25nKCkgewogICAgICAgICAgICByZXR1cm4gTG9uZy5wYXJzZUxvbmcobmV4dCgpKTsKICAgICAgICB9CiAgICB9CgogICAgc3RhdGljIGNsYXNzIE91dHB1dFdyaXRlciB7CiAgICAgICAgcHVibGljIFByaW50V3JpdGVyIHdyaXRlcjsKCiAgICAgICAgT3V0cHV0V3JpdGVyKE91dHB1dFN0cmVhbSBzdHJlYW0pIHsKICAgICAgICAgICAgd3JpdGVyID0gbmV3IFByaW50V3JpdGVyKHN0cmVhbSk7CiAgICAgICAgfQoKICAgICAgICBwdWJsaWMgdm9pZCBwcmludGYoU3RyaW5nIGZvcm1hdCwgT2JqZWN0Li4uIGFyZ3MpIHsKICAgICAgICAgICAgd3JpdGVyLnByaW50KFN0cmluZy5mb3JtYXQoTG9jYWxlLkVOR0xJU0gsIGZvcm1hdCwgYXJncykpOwogICAgICAgIH0KICAgIH0KfQo=
compilation info
Main.java:4: error: class TaskD is public, should be declared in a file named TaskD.java
public class TaskD {
^
Note: Main.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 error
stdout