QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#307371#8128. Alternating Pathsucup-team003#WA 349ms4212kbC++144.8kb2024-01-18 14:48:272024-01-18 14:48:28

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3996kb

input:

3
6 6
1 2
2 3
3 1
4 1
5 2
6 3
6 6
1 2
2 3
3 1
3 4
4 5
4 6
4 3
1 2
4 2
2 3

output:

RRRBBB
BRRBRR
IMPOSSIBLE

result:

ok ok (3 test cases)

Test #2:

score: 0
Accepted
time: 1ms
memory: 4128kb

input:

1
4 6
1 2
1 3
1 4
2 3
2 4
3 4

output:

RRBRRR

result:

ok ok (1 test case)

Test #3:

score: 0
Accepted
time: 0ms
memory: 4140kb

input:

1
5 6
1 2
1 3
1 5
2 4
2 5
3 4

output:

RBRBRR

result:

ok ok (1 test case)

Test #4:

score: 0
Accepted
time: 0ms
memory: 4048kb

input:

1
5 8
1 2
1 4
1 5
2 3
2 4
2 5
3 4
4 5

output:

RRBBRRRB

result:

ok ok (1 test case)

Test #5:

score: 0
Accepted
time: 0ms
memory: 4048kb

input:

1
7 12
1 2
1 3
1 6
2 3
2 5
2 7
3 4
3 5
3 6
4 6
4 7
5 7

output:

RRBRRBBBRRRB

result:

ok ok (1 test case)

Test #6:

score: 0
Accepted
time: 0ms
memory: 4136kb

input:

1
7 13
1 2
1 3
1 4
1 6
1 7
2 5
3 5
3 7
4 6
4 7
5 6
5 7
6 7

output:

BRBRRRBRRRBRB

result:

ok ok (1 test case)

Test #7:

score: 0
Accepted
time: 0ms
memory: 4136kb

input:

1
4 5
1 2
1 3
1 4
2 3
2 4

output:

RRBRR

result:

ok ok (1 test case)

Test #8:

score: 0
Accepted
time: 0ms
memory: 4140kb

input:

1
5 7
1 2
1 4
2 3
2 4
3 4
3 5
4 5

output:

RRBRRRB

result:

ok ok (1 test case)

Test #9:

score: 0
Accepted
time: 0ms
memory: 4020kb

input:

1
5 7
1 2
1 5
2 3
2 5
3 4
3 5
4 5

output:

RRBRRRB

result:

ok ok (1 test case)

Test #10:

score: 0
Accepted
time: 0ms
memory: 4132kb

input:

1
6 6
1 2
1 4
2 3
2 6
3 5
4 5

output:

BRRRRB

result:

ok ok (1 test case)

Test #11:

score: 0
Accepted
time: 0ms
memory: 4052kb

input:

1
6 10
1 2
1 3
1 5
1 6
2 4
3 4
3 5
3 6
4 5
4 6

output:

BRRBRBRRRB

result:

ok ok (1 test case)

Test #12:

score: 0
Accepted
time: 0ms
memory: 4180kb

input:

1
9 14
1 2
1 5
1 8
2 3
2 4
3 6
3 9
4 6
4 7
4 8
5 7
5 8
6 8
7 8

output:

BRRRBBBRBBRRBR

result:

ok ok (1 test case)

Test #13:

score: 0
Accepted
time: 0ms
memory: 4024kb

input:

1
7 12
1 2
1 3
1 4
1 6
1 7
2 5
2 7
3 4
3 6
3 7
4 5
5 6

output:

RBBRRRRRBRRB

result:

ok ok (1 test case)

Test #14:

score: 0
Accepted
time: 7ms
memory: 4132kb

input:

1000
2 1
2 1
2 1
1 2
2 1
2 1
2 1
2 1
2 1
1 2
2 1
1 2
2 1
1 2
2 1
1 2
2 1
1 2
2 1
1 2
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
1 2
2 1
1 2
2 1
2 1
2 1
1 2
2 1
1 2
2 1
2 1
2 1
1 2
2 1
2 1
2 1
1 2
2 1
2 1
2 1
1 2
2 1
1 2
2 1
2 1
2 1
1 2
2 1
1 2
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1...

output:

R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
...

result:

ok ok (1000 test cases)

Test #15:

score: 0
Accepted
time: 7ms
memory: 4052kb

input:

1000
2 1
1 2
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
2 1
1 2
2 1
2 1
2 1
1 2
2 1
1 2
2 1
1 2
2 1
2 1
2 1
1 2
2 1
2 1
2 1
2 1
2 1
1 2
2 1
2 1
2 1
1 2
2 1
1 2
2 1
2 1
2 1
2 1
2 1
1 2
2 1
1 2
2 1
1 2
2 1
2 1
2 1
1 2
2 1
2 1
2 1
1 2
2 1
1 2
2 1
1 2
2 1
2 1
2 1
1 2
2 1
2 1
2 1
2 1
2 1
1 2
2 1
1 2...

output:

R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
R
...

result:

ok ok (1000 test cases)

Test #16:

score: 0
Accepted
time: 7ms
memory: 4132kb

input:

1000
3 3
2 1
1 3
3 2
3 2
3 1
3 2
3 3
2 3
2 1
3 1
3 2
2 1
3 2
3 3
2 3
3 1
1 2
3 3
1 3
2 1
2 3
3 3
2 1
3 2
3 1
3 3
1 3
1 2
3 2
3 3
3 1
2 1
3 2
3 3
1 3
1 2
3 2
3 2
3 1
1 2
3 3
3 2
1 3
1 2
3 2
3 1
2 1
3 3
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RB
BR
RRR
RB
RRR
RRR
RRR
RRR
RRR
RB
...

result:

ok ok (1000 test cases)

Test #18:

score: 0
Accepted
time: 19ms
memory: 3996kb

input:

1000
4 4
2 1
4 2
3 2
1 3
4 4
2 1
1 4
2 4
2 3
4 5
1 3
2 4
1 2
1 4
3 2
4 3
3 4
1 4
4 2
4 6
1 4
3 1
4 2
1 2
4 3
3 2
4 3
1 3
4 3
2 3
4 3
3 2
4 2
2 1
4 5
1 3
2 4
4 3
2 3
1 4
4 4
1 4
3 2
3 4
2 1
4 6
3 4
4 2
2 1
4 1
1 3
3 2
4 6
4 2
1 4
2 3
4 3
2 1
3 1
4 6
4 1
3 4
3 2
3 1
2 1
4 2
4 6
4 1
2 4
2 1
1 3
3 2
3 4...

output:

RBRR
RRRB
RRRBR
IMPOSSIBLE
BRRRRR
IMPOSSIBLE
IMPOSSIBLE
RRRBR
RRBR
RRRBRR
RBRRRR
BRRRRR
BRRRRR
RRRB
BRR
RRRRRB
RRRB
RBRR
RBR
BRRRR
RRRBR
RRRB
RRBRRR
RRBRR
RRB
RRBRRR
BRRRRR
BRRRRR
RBRRRR
RRBRR
RBRRRR
BRRRR
BRR
IMPOSSIBLE
RRRB
RBRR
BRR
RRRB
RRRBRR
IMPOSSIBLE
BRR
RBRRR
IMPOSSIBLE
IMPOSSIBLE
RBRRRR
RRB...

result:

ok ok (1000 test cases)

Test #19:

score: 0
Accepted
time: 21ms
memory: 4080kb

input:

1000
4 6
4 2
4 1
3 4
3 1
1 2
3 2
4 3
4 2
3 2
1 3
4 6
4 3
1 2
2 3
1 3
2 4
4 1
4 4
2 1
3 1
4 1
3 2
4 5
2 4
1 2
1 3
4 1
3 2
4 3
2 3
2 4
1 4
4 4
1 2
3 2
1 4
2 4
4 5
2 1
1 3
3 2
4 1
4 2
4 4
1 2
4 2
3 2
4 1
4 6
2 4
3 4
3 2
3 1
4 1
1 2
4 3
1 3
2 4
3 2
4 6
4 3
4 1
2 1
4 2
3 1
3 2
4 4
1 2
4 3
1 3
2 3
4 6
3 2...

output:

RBRRRR
RBR
RRRRRB
RRBR
RRRBR
RBR
RBRR
RRRBR
RRBR
RRRRBR
RRB
RBRRRR
RBRR
RRRBRR
RBRRR
IMPOSSIBLE
RBRRRR
RRRB
RRRRB
RRBRR
RBR
RRRRB
BRRRRR
RBRRR
RRRRBR
RRRRB
RRRBR
RRBR
RBRRRR
RBRR
RRBRRR
BRRR
RRRBRR
RBR
RRBRR
IMPOSSIBLE
RBRRR
RBRR
RRRRBR
BRRR
RRBR
BRRRRR
BRR
RRRBR
BRRRRR
RRB
IMPOSSIBLE
RRRB
RBR
RRRBR...

result:

ok ok (1000 test cases)

Test #20:

score: 0
Accepted
time: 31ms
memory: 4056kb

input:

1000
5 8
5 1
4 5
2 4
3 2
2 1
5 3
1 3
3 4
5 9
2 4
4 5
5 2
1 5
3 1
3 5
4 1
4 3
1 2
5 5
1 4
3 1
1 5
5 2
4 2
5 9
1 2
5 4
4 3
4 2
4 1
5 3
1 5
5 2
2 3
5 9
3 4
3 2
2 5
3 1
4 5
5 3
4 1
1 5
4 2
5 10
3 5
2 1
2 5
5 4
1 3
4 2
1 4
5 1
2 3
4 3
5 5
3 4
5 3
5 1
5 4
2 5
5 6
1 2
2 4
1 5
3 2
3 1
3 4
5 8
4 2
4 3
1 2
1 ...

output:

BRBRRRRB
RRBBRRRBR
RBRRB
RRBRRRBBR
RBRRBRRBR
BRRRRBBBRR
BRBRB
RBBRRR
RRRBRRRB
BRRB
BBRRBRBRR
BRRRR
RRRRBR
RBBRR
RRRBRBBBRR
BRBRB
RBRRRRBRB
RRRRBR
RRRRRB
RRRBBRBBRR
IMPOSSIBLE
RBRRBRR
RBRRBB
RRBBRBRRRB
RBRRRBRRB
IMPOSSIBLE
RRBBRBRRBR
RRBRRBRR
RRRRBBRBBR
IMPOSSIBLE
RBRRBRRRBB
RRBRBRRBR
BRRBRRRBR
BRRRR...

result:

ok ok (1000 test cases)

Test #21:

score: 0
Accepted
time: 30ms
memory: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BRRRRRBRBBRRB
RRRBBBRBRBRRRB
BBRRRRRRBRB
BRRRBBRRR
RRRRRRBBRBBB
RBRRRBRBBRBB
RRRBBBBRRRBBRR
BBBRRRRBR
BRBRRRBRRBRB
BRBRRBBBRRRRRRR
RRBBRBRRBRBR
RBRRRBRBRR
RBBRRR
RRBRRRBRB
RRBRRBRRB
IMPOSSIBLE
RBRRBRRBBRRBB
IMPOSSIBLE
RRBRRBR
IMPOSSIBLE
I...

result:

ok ok (1000 test cases)

Test #23:

score: 0
Accepted
time: 43ms
memory: 4144kb

input:

1000
6 7
4 3
2 4
2 6
1 2
6 4
5 1
3 5
6 13
2 6
4 6
2 5
4 2
4 1
3 6
4 5
2 1
1 3
6 1
5 6
1 5
3 2
6 14
2 6
6 4
2 1
3 4
1 5
5 3
3 6
2 4
1 6
4 5
5 2
6 5
1 4
3 2
6 14
5 2
6 5
3 2
1 4
5 1
1 6
6 3
5 4
2 4
3 5
6 2
3 1
3 4
6 4
6 5
6 5
4 3
3 2
2 6
1 6
6 15
3 4
2 3
4 2
3 1
6 3
4 5
1 5
6 1
1 4
6 5
5 3
4 6
6 2
5 2...

output:

RRRBRRB
BRRRBRBRRRBBR
BRRBBRRRRBRBRB
RBBRBBRRBRRRRB
IMPOSSIBLE
BRBRRRBBRBRBRRR
BRBRRBRR
BRRBBRBRRRBRRRR
BRRRRBBBRRBRRB
RBBRBRRRRR
BRRRBBRRRRB
RBRRBBRR
RBBRRBRRRBBRR
RRRRBRRBBB
BRRBRR
BRRBRR
RBBRBRRBRRR
RRBRBRR
BRRBRR
RRBBBBRRRRB
RBRRBRRBRRBRBB
RRRBRBRBR
BBRRRBBRRRR
BBRRR
RBBBRRRRBR
BBRRRRR
RBRRBBRRR...

result:

ok ok (1000 test cases)

Test #24:

score: 0
Accepted
time: 47ms
memory: 4004kb

input:

1000
7 15
5 1
5 4
7 4
2 5
3 4
3 7
5 6
3 6
2 4
6 4
1 6
2 6
7 5
7 1
3 1
7 15
4 1
6 4
3 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
IMPOSSIBLE
BBRRBRRR
BRBRBRRBRRRRBBRRRBB
RRRRBRRRBRBBBBRRBR
IMPOSSIBLE
RRBRRRBRBBR
RRRRRRBBBBB
RBRBBRRRBBRR
RRBRBBRBBRRBBRBRRRRBR
BBRRRRBBRRRRBB
R...

result:

ok ok (1000 test cases)

Test #26:

score: 0
Accepted
time: 54ms
memory: 4136kb

input:

1000
8 12
1 6
7 2
7 8
5 2
8 4
8 1
8 5
2 6
1 5
3 6
4 7
8 3
8 28
2 3
5 4
8 4
8 2
4 6
1 2
6 5
2 6
5 8
7 1
1 6
2 5
3 1
7 2
4 3
3 6
8 7
4 2
5 7
8 1
5 1
3 8
7 3
4 1
7 6
5 3
6 8
4 7
8 24
1 2
5 2
1 8
7 4
2 4
4 6
8 5
8 6
2 7
8 4
2 6
1 5
6 5
3 8
4 5
3 4
5 7
1 4
2 3
6 1
8 7
5 3
3 7
8 2
8 28
7 2
7 1
7 5
3 6
3 7...

output:

BBRBBRRRRRRB
RBRBBRRRRBRBRRRBBRRRBBRBBBRR
RBBBRRRBRRRRBRBRRRBBBBRB
RBRRBBBRBBBRRBRRRRBRBRBRRBRR
BBBBRRRB
RRRRBRBBBRRRRBRBRBBR
BRRRRBBRRBBRBRRBBBRBBBRR
BRBRRRRRBRB
RRBRRBBRRBR
RRBRRBBRRBRBBRRB
BBRBRRBRRRRBRRBBRBBBR
RRBBRRRBBBRRRBRBBBRRR
RRBRRRRBB
BRRRBRRRRB
BBRRBRRBRRRBRRBBRB
BRBBBRRBRRBRRRRRBBR
BBRR...

result:

ok ok (1000 test cases)

Test #27:

score: 0
Accepted
time: 58ms
memory: 4144kb

input:

1000
8 27
8 3
6 2
7 3
5 4
2 7
3 6
1 4
5 6
6 1
4 3
3 2
1 5
3 5
8 2
1 7
5 7
7 6
8 6
4 7
4 2
4 8
5 8
8 7
4 6
1 3
1 2
1 8
8 13
4 1
7 1
6 2
6 3
3 5
2 1
1 8
6 5
6 8
2 8
2 3
7 8
1 6
8 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POSSIBLE
RBBBRBRRRBBRBBBRRRRBRBR
RRBRBBRRRBRBRRRR
BRBRR...

result:

ok ok (1000 test cases)

Test #29:

score: 0
Accepted
time: 48ms
memory: 4040kb

input:

1000
9 17
8 3
9 7
3 5
2 8
9 5
2 5
1 9
8 7
1 7
4 7
3 2
2 1
3 9
8 5
6 8
8 4
9 4
9 36
4 3
9 1
8 2
3 2
7 4
2 7
3 6
9 5
7 5
6 7
6 8
4 1
5 3
2 1
1 5
2 6
4 6
2 5
8 3
7 3
1 8
4 9
1 6
3 1
7 1
9 8
8 7
8 5
4 8
6 9
5 6
4 2
5 4
3 9
2 9
7 9
9 27
6 1
6 3
1 5
7 1
7 2
3 7
2 5
5 9
4 2
7 5
7 6
3 1
7 9
4 8
1 4
4 3
8 1
...

output:

BRRRBRRRRBBBRBBRR
BBBRRRRRBBRRBRBBBRRBBRRRBBRRBBRRBRBR
BRBRBBRBRRBRRBRRBRRRBBBRBRR
IMPOSSIBLE
RRBBRRRRBBRBRRB
BRBBRBRRBBRRBBRRRRRBBBRRBRR
BBRBRBBRBRBRBRRRRR
RRBBRBRBRBBBRRRRBBRBRBRRRBRRRBBRBBB
BBBRRRBRBRB
RBRBRRBRRBBRBR
BRRBRBBRRBRBRRBBRBRRRRRRRBRBBBRB
BRRRRBRRRBRR
RBBRRRRRRBBRRBBBBRBBRBBR
BRRRRRBBR...

result:

ok ok (1000 test cases)

Test #30:

score: 0
Accepted
time: 68ms
memory: 4000kb

input:

1000
10 40
7 10
6 3
1 8
5 1
5 4
9 7
1 10
10 8
9 4
3 10
2 7
7 8
4 10
2 10
6 10
3 4
1 7
5 8
5 7
1 6
7 3
2 3
3 8
9 8
6 2
3 5
7 4
1 2
2 8
9 1
2 9
5 10
6 8
10 9
3 9
6 7
4 6
2 5
6 9
6 5
10 33
9 3
6 3
2 6
3 4
8 9
10 5
7 5
10 1
8 5
7 6
3 10
3 5
9 6
5 9
9 7
3 7
10 2
9 1
4 5
4 10
3 2
4 9
4 8
3 8
2 5
4 7
8 2
8...

output:

BBBRRRBRBBBRBRRRRBBRRRBRBRBRBBRRRRBBRRBB
RBBRBRBBRRBRRBBRRRBBBBRRRBBBBBRRR
RRBBBRBBBRRRRRBBRRBBRBRRRBRBRRBR
RRBBRBBRRRRRBBRBBRBRBRRBBBRBBBRRR
RBBBRRBRBRRBRBRBRRBRRRBBBRBRBR
RRBRBRBRRBRRBBBBRBRRRBRRBRRBBB
RBBBRRRBRRRRB
RBRBBRBBBBBRRRRBRBRRRBBBRRRBRBRBRRRBBRRBR
BRBRBRRRBRRBRBRRBBB
BRRRBBBRRBRRBBBBRRBB...

result:

ok ok (1000 test cases)

Test #31:

score: 0
Accepted
time: 58ms
memory: 4060kb

input:

1000
10 24
2 7
3 9
5 2
5 1
6 4
6 5
6 10
7 9
5 7
8 1
4 7
10 8
3 7
10 7
9 1
5 9
9 2
2 4
10 1
8 2
8 6
2 1
9 4
5 4
10 42
2 1
3 8
7 3
4 6
7 1
2 5
7 5
4 1
10 9
2 10
2 3
3 5
6 7
1 9
8 5
7 8
10 5
1 8
1 6
10 3
6 8
8 9
1 5
3 1
2 4
4 7
9 7
4 10
5 4
10 6
10 1
2 9
8 10
7 10
3 9
7 2
6 3
9 5
3 4
2 6
9 6
4 8
10 21
...

output:

RRRRRBBRRBBRBBBRBRRBRRBB
RBRRBBRBBRRBBRRRBBRRBRRRRBBRBBBBBRBRRRBBRR
RBBRRRRBRBBRRRBBBBRRB
RBRRBRBBBRBRRBRBBRBRRRBBBRRBRBRBRRBRBBBR
RRBRBRBRRBBRRBRBRRBBRBBBBRRRR
RRBRBRRBBBRRBRBBRBRRR
RRBRRBBBRBBBBRRRBRBBRRRRRRBBBBBRRRRRBBBBBBR
RBRRRBRBBRRRBBRBRR
RBBRBRRRRBBRBRR
BRRBRBBBBRRBBBRRRRRRRRBRBBRBRBBRB
RBBR...

result:

ok ok (1000 test cases)

Test #32:

score: 0
Accepted
time: 60ms
memory: 4032kb

input:

1000
11 50
5 1
1 10
5 7
11 1
7 8
5 2
5 11
10 9
2 4
10 7
3 1
3 11
3 6
2 10
9 4
9 5
10 3
8 4
11 4
7 11
10 8
5 10
9 7
6 5
4 7
9 3
9 2
10 11
9 6
7 1
2 8
2 11
11 8
3 5
1 9
6 1
4 5
4 3
4 1
10 4
9 8
6 7
8 3
6 2
2 3
2 1
3 7
6 8
6 10
2 7
11 32
3 2
5 8
5 3
3 8
3 11
1 3
11 8
5 7
7 9
10 1
10 11
7 10
9 2
6 9
10 ...

output:

BBRRBRBRBRRBRBBRRRRRBBBBBBRRBBRBBRRRRRBBRRRBRRBBRR
RRRBBRRBRBRBBBRRRBRRBBRBRBRBRRBB
RBRBBRRRBRBBBRBBRRBRRBRBRBBRRRRBBRRR
RBBRRBBRRBRRRBRBRBRBRRBBRRRBRBRBBRRRRBBRBBB
BRBRBRBBRRBBBBBRRRRBBRBRRRRBRBBRRRRRBBBBR
BRRBRRBBRBRBBBRBBRRRRBRBRBRRRBRBBBRRRR
RBBRBRRRBRRRRRBBRRBRRBRBRBBRBBBRBRRBRBBBRBBBRBBBR
IMPO...

result:

ok ok (1000 test cases)

Test #33:

score: 0
Accepted
time: 60ms
memory: 4064kb

input:

1000
11 29
3 5
10 9
11 5
8 9
5 1
4 11
4 10
7 11
3 2
11 6
4 7
6 3
8 2
1 10
7 9
6 1
9 3
11 8
7 2
4 2
2 10
1 8
4 9
4 3
6 5
1 7
1 4
10 8
1 2
11 39
7 1
7 11
8 4
5 9
10 9
3 10
7 10
3 11
9 1
5 1
5 2
1 3
8 7
6 11
5 11
6 3
11 1
9 8
4 2
11 8
11 9
4 7
2 7
10 5
2 3
5 7
4 5
6 5
3 7
10 4
6 1
8 10
5 8
3 4
7 9
1 8
...

output:

RRBBBRBRBBBRRRBBBRRRBBRBRBRRR
BRRRBRBBRBRRRRBRRBBBBRBRRRBBBBRRRRRBBRR
RRBBBRBRRBRRBRRRBRBBBBRRBBRRBRRBRRRBBBRBRBBBR
RBRRRRBRRBBBRBRBBRBRBBBRBRRRBRRRBBBRBR
RRRRBRBRRBRBRBBRR
RBRBRRRBRRBBBRRBBRBRBR
RBBBRRBBRRBBBRBRBRBRBRRRRRBBBBBRBRBRBRRRBRRBRRBRB
RBRBBBBRRBRRBRBRRRRRB
BBRRRBBRRBRRBBBRRBBRBRBRRRBBRBRR...

result:

ok ok (1000 test cases)

Test #34:

score: 0
Accepted
time: 72ms
memory: 4152kb

input:

1000
12 25
6 9
3 1
6 10
11 6
12 1
7 8
11 12
6 5
4 1
5 4
7 5
6 7
8 1
6 2
12 4
10 11
9 12
2 9
8 4
7 3
6 1
6 8
7 2
11 3
5 12
12 25
8 5
1 8
2 12
5 1
7 5
8 4
1 11
6 7
7 4
4 1
12 10
8 11
12 6
8 2
6 10
10 9
6 2
7 10
4 3
9 6
10 2
5 2
11 12
1 7
9 5
12 24
6 8
7 8
12 10
4 10
12 5
8 12
3 1
1 11
12 3
4 5
1 5
11 ...

output:

BBBBBBBRRBRBRRRRRBRRRRBRB
RBBBBRRRRRRBRRBBBRBRRRBRB
RBRBBBRBRRBRRBBRRRBBBRRR
RBBBBRBRBRRBBRRRBBRRBRRRBRRBBRRRBRBBRBRRBBRRRBBRRBBBBBRBR
RBBBRBBRRBRRRBRRRBBRRRRBRBRRBBRBRBBRBBBRRRBRRBRBRB
RRBRBBRRRBRRBBBBBRRRBBRRRBRBBBBRBRRBR
RRBRBRRRBBBRBRRRRRRBBBBRRBBRRRRRBB
BRBBBRBRRRBBRBBBRRRBRRBRRBRRRBBRBR
BRBBRR...

result:

ok ok (1000 test cases)

Test #35:

score: 0
Accepted
time: 65ms
memory: 4192kb

input:

1000
12 52
7 9
4 7
2 8
10 11
4 2
1 4
9 1
10 5
1 10
9 2
3 11
8 6
5 7
3 7
6 1
5 9
10 9
2 7
5 4
3 4
2 10
12 6
5 1
2 3
12 11
5 6
3 10
3 1
4 11
7 1
6 2
9 12
3 6
12 2
5 11
12 7
1 8
1 2
11 7
12 8
6 9
3 9
8 5
1 12
3 5
6 10
6 4
3 12
10 8
8 9
6 11
12 5
12 49
12 1
5 2
8 6
11 6
7 9
6 4
11 5
12 2
7 3
5 1
12 9
4 ...

output:

BRBRRBRRBRBRBRBBBBBBBBRRBRRRRRRRBRBBBRRRBRRRBRBRBRRR
BBRBBRRRRBRRBBRBBBBBRRRBBBRBRRRRRBBRBBBRBRBRRRRBR
RRBRBRRRRBRBBBRRBRBBBBRBBBBRRRBRBRRRRBRRRBBRB
BBRBRRBBRBRBRRRBBBRRRRRBRRRBBBBRRBBRBR
BRBBRBBRBRRRBRBBRRRBRRRBRRRR
RRRBRBBRRBBBRBBBRBRRRRBRBRRBBRBBRRRRBBBBBRBRBRRRRRRBBRBRBR
BRBBRRBRRRRRRRBB
RRBBRBB...

result:

ok ok (1000 test cases)

Test #36:

score: 0
Accepted
time: 81ms
memory: 4136kb

input:

1000
13 28
8 2
11 13
9 11
1 8
7 8
5 8
2 13
13 9
11 3
11 7
4 5
4 7
10 12
8 13
7 13
6 3
3 5
6 12
7 2
4 13
7 3
8 12
10 2
6 9
4 11
10 11
1 5
3 13
13 19
12 11
7 8
4 5
6 9
10 13
8 2
10 6
7 13
10 3
2 4
4 13
7 2
5 3
5 1
3 7
12 5
8 5
12 8
9 8
13 40
7 13
13 4
12 11
8 9
3 6
12 6
5 12
9 11
2 12
8 1
3 4
6 1
13 1...

output:

RRBRBRBRBRBRBBBRRBBRRRRBBRRR
RRRRBRBRRBRRBBBBRRB
BRRRRBRBBBBBBRRRBBRBRBRRRBRBRRRRBBBRBRBR
BBBRRBBRBRRRRRBBRBBBRRRBRBRBRRRBRBRRRRRBBB
RRBRRBRRBRBBRBRBBRBBBBBRRBBRRRRRBRBBRBBRRBRRBRRRBRRBBRRRRBBRRBBBRRBBRRRB
RBRBBRRRRBBBBRBRBRRRBRRBBRRBRBBRRBRBBRBRRRRRBBBBRBBRRBRRRRBRRBBBBR
RRRBBBRRRBBBRBRRRRRBBBBRRRB...

result:

ok ok (1000 test cases)

Test #37:

score: 0
Accepted
time: 68ms
memory: 4000kb

input:

1000
13 70
8 2
8 12
13 1
2 10
13 2
7 3
5 4
8 7
7 9
10 4
11 6
1 12
12 13
1 5
1 9
12 9
3 2
12 2
6 13
13 11
12 3
1 11
8 6
8 4
7 13
7 6
10 11
9 11
11 7
5 9
11 2
8 13
8 5
8 1
9 6
2 9
2 6
8 11
9 13
11 5
12 11
13 3
7 5
13 10
6 10
4 11
8 10
7 2
6 4
3 9
3 5
4 9
6 3
5 13
4 2
10 7
10 9
4 12
8 9
2 1
7 1
3 8
3 1...

output:

BRBBRBBRRRRBRRRBRRRBBBBBBBRBRRBRBRBRBRBBBRRBRRBBRRBBBRRBRRBRBRBRRRRBBB
BRRRRBBRBBRRRRBRRBBBBBRBBRRRRBRRRRBBBRBRRBBBRRRBRBBRBBRRBRRBBRBBBB
RBRBRRBRRBRBRBBRBBRBRBRBRRRRBBBRBRBRB
IMPOSSIBLE
BRRRBBBBBRBRRBRRBRBRRRBBRRBBRBRBRRRRRBRRBBRBBRRBBRBBBRRRBRBRRRRBBBB
RRRBRBRRRRBBRBBBBBBRRBRRBBBRR
BBRRRBBRRBRBRRB...

result:

ok ok (1000 test cases)

Test #38:

score: 0
Accepted
time: 72ms
memory: 4032kb

input:

1000
14 89
8 6
14 12
3 2
14 7
14 4
11 10
5 14
9 13
3 9
12 2
2 8
1 11
11 5
3 1
14 1
8 5
4 9
12 11
13 2
10 6
12 10
11 13
8 3
11 2
9 11
8 13
7 1
4 1
7 2
4 6
5 4
11 14
7 13
8 12
1 10
5 2
6 7
4 11
10 5
9 12
1 13
13 10
7 4
12 13
6 13
9 5
3 12
10 2
6 2
7 5
10 7
13 5
8 9
14 8
10 4
14 9
6 9
2 9
3 4
4 13
9 1
...

output:

RBRRBRBBBRBBRRRBRBRBRBRBRRBRBBRRRBBRRBRRBBBRRBBBRBRBBBBRBBRBRBRRBRRRRBRBBRRBRRBRRRRBBRBBB
RRRBBBRRBBRRRBRBRBBRBBRRB
RBRBRBRRRBBBRRBBBRRRBBBRBBRRRBBRRRRBRBRBRRBBBBRRRB
RRBBBRRRRBBBBBRBBBRRRRRRRRBRBBBRRRBBBRRRBBBBBBRRRR
RRRRBBRBBRRRRRRBBRRBBRBBBBRRBRRBRBBRBBBRRBR
BRBRRBBRBBRBRBRRRRBBBRRRBRBBBRBRRRRBBR...

result:

ok ok (1000 test cases)

Test #39:

score: 0
Accepted
time: 63ms
memory: 4064kb

input:

1000
14 31
7 10
12 6
9 1
14 4
7 2
7 12
14 11
6 7
10 6
14 13
10 1
7 1
7 9
11 8
13 4
14 7
13 5
9 10
6 2
2 13
4 8
6 13
4 7
7 13
11 13
12 10
12 8
9 5
13 8
11 3
9 11
14 39
10 4
13 9
7 5
10 6
14 2
1 10
12 7
3 7
10 11
6 12
1 12
4 9
11 13
12 3
3 10
10 8
7 14
11 12
13 3
1 5
2 6
12 4
9 12
5 12
11 14
1 13
8 14...

output:

RBRBBRBBRRBRRRRRBBRBBBRBRRBRBBB
RRRBRBBRRRRBBBBRRRRRBRBBBBBBRRRBRBBBRBR
BBRRRBRRRRRBBBBRBRRRBR
RBBBRBRRBRBBRBBRRRBRBBBBBRBBBRBRRRBRRRRRRRBRRRRBBBRBRBRRBRBBRRBRBBBRBRBBRBRRR
BBBRBRRBRRRBRRBBBBRRBRBBRRRRBBBRRRRRBBRBBBRRBRBRRRRBBRBBBRBRB
BBRBRRRBBRBBRBBRBBBBBRRRRRBRBRRRRRBRRBRBRBBR
RRRRBBBBBRBBRRBRRRRB...

result:

ok ok (1000 test cases)

Test #40:

score: 0
Accepted
time: 83ms
memory: 4032kb

input:

1000
15 52
8 6
15 14
2 5
11 3
4 2
1 13
14 8
8 4
6 5
5 8
13 3
10 8
6 14
10 12
8 9
7 2
9 5
1 2
12 5
12 4
2 3
5 11
9 15
6 15
9 14
7 5
13 11
5 3
10 1
9 4
7 8
3 15
15 7
9 1
10 14
7 10
9 11
15 8
13 4
9 3
15 12
8 3
5 13
15 1
3 6
13 15
8 2
15 4
2 13
13 9
4 14
5 1
15 56
3 7
8 5
6 1
11 12
14 5
13 5
4 6
8 2
15...

output:

RRRBRBBBBBRRBBRBBRRBRRBRRRRRRRRBBBBBBRBBRBBBRRBBRRRR
RRBBBBRBRRRBBBBRRRBRRRRBRBRRBBBRBBRBRRBBRRRBRRRRBBBBBBRR
BBBRRRRBBBRRBBRRBBRRRRBRBBBBRBRRBBBRBBRBRBBRRBBRRRBBRBRRBRRBRBRRBRRRRRBRRBBRRRBBRRRBBBBBRRR
RRRRBRRBBRBRRRBBRBBR
BRRRRBBRBBRRBRRBRRRBBBRBBRBBRRBRBRRRRRBBRRRBRB
BRBRBBBRBRRRBRRBRRBRRRBRB
RRBR...

result:

ok ok (1000 test cases)

Test #41:

score: 0
Accepted
time: 86ms
memory: 4060kb

input:

1000
15 14
8 14
7 2
5 2
3 12
11 9
14 2
11 2
5 13
15 6
1 11
9 4
5 10
11 15
14 12
15 37
5 13
9 5
7 11
5 10
13 10
10 8
8 5
8 9
5 3
1 6
4 3
10 11
11 1
13 3
1 3
12 7
10 2
1 12
7 3
8 13
14 5
13 11
8 3
15 4
2 13
15 14
1 14
13 14
3 15
7 8
4 9
12 6
2 9
2 6
6 9
5 7
2 7
15 31
15 5
2 5
5 3
6 14
4 9
7 3
10 9
8 4...

output:

IMPOSSIBLE
BRRBRRRBRRRBBBBBBRBBBRRBRRRBBBRRBBRBR
RBBRRRBBBRBRBRBRRRRBRBRRBRBRRBB
RRBBRRBRRRRBBRBBBRBRBBBRRRBRBR
BBRBBBRRRBBRRRB
RRRRBBRBBBBBBRBRBRRRBRBRBRBRRBRRBBRRBRRBBBBRBRBRRRRRBRRBRBRBBRRBBR
RRBBRRBBBBBBRRRBBBRRBBRBRRRRBRBBBRBRRRBBBRBRRRBRBRBBBRBRRBRBRBRRRRRBBRRRRRBBBRBRBRBBRBRBBBBRR
BBBRRRBRBBR...

result:

ok ok (1000 test cases)

Test #42:

score: 0
Accepted
time: 81ms
memory: 4156kb

input:

1000
16 37
7 5
6 9
4 15
7 10
7 15
11 3
5 6
13 2
1 4
2 10
6 15
1 3
14 1
16 7
15 12
7 9
9 10
2 12
4 2
13 6
6 2
8 16
13 4
3 7
9 8
16 5
10 1
6 7
13 7
10 4
1 9
2 15
6 16
12 13
1 8
4 8
10 16
16 101
1 2
4 7
12 15
8 16
11 9
14 13
12 14
6 9
16 12
16 4
11 16
16 3
2 13
15 4
5 11
12 3
5 9
10 8
2 5
10 1
15 1
3 4...

output:

BBRBRRRBRRBBRBBRRRBRBRRRBRBRBBRRBBRRR
RBBBRRBBRRBBBRBRRRBBRBRBBRRRBRBRBRRRRBBBRBRRBBRBBRRRRBRRBBBBRRRBBBBRRBBRBBRRRRRRRRBRBRRRBBRBBBBBRBRBB
RBBBBBRRRRRBRBRRBRBBRRBBRBRBRBRBBBBRBRBRBRBBRRRBRBBRRRRBRBRRBRRBBRRBRRBBBBRBRRRRBRBRBRBBBRBBBRBBRRRBRRRRBBBBBRBRR
RBRBRBBBRRBRBBBBRRRBRRBRBBBRBBRBBBRRRRBBRBRBBR...

result:

ok ok (1000 test cases)

Test #43:

score: 0
Accepted
time: 78ms
memory: 4036kb

input:

1000
16 45
12 13
12 7
12 3
6 13
13 7
13 3
4 11
5 13
10 8
13 4
10 13
3 6
4 3
15 2
9 11
16 14
11 2
11 15
15 5
9 5
5 14
4 7
15 6
8 2
6 8
10 1
1 4
7 2
1 5
2 16
14 7
9 12
10 2
3 8
11 16
12 4
12 16
9 13
1 9
12 11
8 14
13 11
2 1
13 14
12 10
16 116
15 14
3 8
8 4
7 15
2 6
6 4
11 3
7 9
5 7
5 14
7 11
1 6
16 2
...

output:

RBBBRRRBRRBRBRBBRBBRRRRBBRBBBRBRRRBBRBRBRRRBR
BRRRRBBBBRRBBRRRBBRBRBRRBBRRRBBRBBRRRRBBBBBRBRRRBRBBRBBRBRRRBRBRRRRRRBBBBBRBBRBBRBRRBRRBBBBRBRRRBBRRRRBBBBRRBRRRRBRB
BBRBBBRRBBRRRRRRBBBRRRBRRRBRBBBRBRBR
RBBBRRRBRBBBBBRRRBRBBRBRRRRRBRBBBRRBRRRRRRBRBRBBBBBBRRBBRBRRRRBBBRBBBBRRRBBRRRBRRRBRBRBRRRBBRBBRRBBR...

result:

ok ok (1000 test cases)

Test #44:

score: 0
Accepted
time: 85ms
memory: 4064kb

input:

1000
17 43
2 4
10 12
7 17
10 4
15 17
16 15
5 14
5 3
4 11
7 3
1 2
16 6
12 8
15 12
8 15
4 6
8 16
11 8
16 5
13 1
14 17
14 16
11 1
15 6
16 17
8 2
14 3
9 1
17 13
6 10
3 17
17 8
13 15
11 3
3 12
8 9
17 10
13 8
8 5
11 7
11 13
7 15
4 1
17 135
16 2
13 6
8 15
15 12
13 15
13 7
10 11
12 11
11 3
5 9
17 7
17 11
5 ...

output:

RBBRRBRBRRRRRRBBRBBBBBRBRBRBRRRBRBBRBBRRRBR
BRRBRBBRBBRRRRRBBBBBBBRRRBRBBRRBRRBBRBBRRRRBBRBRBRRBBRBRRRRBRBBRBBRBBRBRBRBRBBRBBRRBRRRBBBBRRRRRBRBRBRRBBRBRRRBBBRBRRBBRBRBBBRRBRRRRBBB
RBBRBRBBBRRRBRRBRRBBBBBRBBBRRRRBRRBBBRRBBRRRRBBRRRRBRBRRRRBBBBRRBRRRBBRBBRBBBRBRBR
RRBBRRBBBBRRBBBRRRRRBBBRBBBRRRRBRRRRB...

result:

ok ok (1000 test cases)

Test #45:

score: 0
Accepted
time: 105ms
memory: 4012kb

input:

1000
17 111
16 13
8 4
2 17
2 5
11 17
12 16
9 8
4 6
17 8
2 10
17 4
2 6
3 2
13 6
15 4
9 10
8 3
5 6
2 4
7 9
9 2
11 12
3 13
5 11
17 13
13 4
13 14
7 1
16 4
6 1
16 8
17 6
17 15
10 13
8 2
3 15
12 6
10 8
9 16
4 1
15 2
4 12
7 4
1 14
11 14
16 6
16 10
9 4
14 7
3 11
1 17
9 3
12 8
4 14
5 17
4 5
1 16
17 7
6 10
6 ...

output:

BRBRRRBBRBBRRRBRBBRRBBRBBRBBBBRRRBBBRRRRRBRRBBBBRRBBBRRRRBRBBRRRRRBRBBBRBBRBBBRRRBRBBBBBRRRBRRBRRBRBBBRRRBBRBRR
RBBBRRBBBRRRRBBBBBRRRBBBRBBRRBRBBBBRRBRRRRBBRRRBBRRRRBBBRRRRBBBBRRRRR
BRRRBRBBBRBBRBRBRRRBBRBBRRRBBBRRRBBBBBRRBBRBRRRBBRRRBBRBRRRBRBBRRRRRBRBBBBBRRBRRRBBBRBRBRRBRRBRRBBRBRRRBBRBRRBBBBRBRBR...

result:

ok ok (1000 test cases)

Test #46:

score: 0
Accepted
time: 98ms
memory: 4148kb

input:

1000
18 73
10 12
5 11
12 17
5 15
11 14
1 17
16 11
13 10
18 9
18 5
17 10
12 9
14 4
3 12
2 5
2 17
5 13
8 13
10 2
2 3
15 17
12 16
5 4
1 4
8 7
7 18
11 7
16 9
10 4
5 3
17 13
17 11
3 15
15 18
2 18
17 7
9 13
5 17
2 6
18 6
8 16
6 15
16 17
5 14
10 6
2 11
10 3
3 13
18 17
18 1
1 3
15 7
14 10
7 9
4 16
5 10
15 4...

output:

BRRRBBBRRBRBRRRRBRBBBRBRBBRRBRBRBRRRBBRBBBBBRBBRRBRRRRRBRRBRBRRBBBBRBBBRB
BRRBRBRBRBBBBRBRBBBBBRRRRRRRRRRBBBRBR
BBRRBBBRRRRRRBBRRBBRBRBRBRBRRBRRRRBBRBBBBBRBRBRRRBBBBBRBBBRRRRBRRRRR
BBRBRRRBRRBRRRBRBBRRRBBBRRRBRBBRRRBBRBRBRBRRBRBBRRBBR
RBRRBBBBRRBRRRRBBBBRRBBBRRBR
RRBBBRBRBRRRRBBRBBRBRBBRRRRRBBBRRBBR...

result:

ok ok (1000 test cases)

Test #47:

score: 0
Accepted
time: 83ms
memory: 4012kb

input:

1000
18 28
5 16
11 7
10 6
6 3
17 13
3 1
15 11
17 1
18 14
2 1
8 4
17 10
1 4
8 6
5 9
3 11
13 15
17 5
18 4
12 13
16 11
11 14
4 15
2 11
18 15
9 18
15 16
13 10
18 77
5 8
17 12
5 3
8 2
4 13
15 16
10 18
12 5
5 15
2 7
12 2
6 4
1 6
14 10
4 9
15 2
15 9
15 3
8 15
17 15
15 13
10 17
16 2
18 13
6 16
15 1
8 11
4 1...

output:

RRBBBBBRBBBRRRBRRBRRBRRRRRBR
BRRRRRBBRBBRRRBRRBBBBRBRRBRRBRBBBBRRRBBRBRRBBBBRBRRRRBBRRBRBRBBRRRRBBBRBBRRBR
BBBBRRBRBRRRRRBBBRRBRRBRBBB
BBRBBRRRBRBRBRRRRBBBRBBBRBRRRRBBBBBBBRRRBBBRRBBRBRBBBRRBBRRRRRRBBRBRBRRRBBRRBBBBRRRRBRBRRRBBRRBRRBBRBRBRBRBRRRRRBBBRRBBBBRBRRRBB
RBBBRBRRRRBRRRBBBRBRBRRBRBRBBRRRRBBB...

result:

ok ok (1000 test cases)

Test #48:

score: 0
Accepted
time: 105ms
memory: 4008kb

input:

1000
19 80
5 13
18 2
10 2
18 17
19 18
7 4
6 15
4 15
18 13
8 11
16 11
9 14
18 4
6 2
7 12
8 18
3 18
9 10
14 19
18 9
6 4
17 9
6 7
15 18
13 2
14 2
17 19
6 19
18 7
9 1
1 18
8 10
14 8
9 4
14 13
4 13
15 8
15 17
2 9
19 2
5 11
14 10
5 16
2 4
16 19
8 3
19 3
3 14
16 13
19 12
3 11
3 13
15 9
4 8
5 4
17 14
2 15
5...

output:

RBRBRRBBRRBRRRBBBBBRRRBBBRBRRBRBBBBBRRBRBRBBRRBBRRRBRRRRBBRBBRBRBRRRBRRBRRBRRBRR
RBRRBBRBBRRRBRRBBBBRRBRBBBRRRBBBBBRBRRBRRRRRRRBBRRBBBBBRBRRRBRBRRBRBRBBRRBBBRRRRRRRBBBBRBRBBRRBBBBRBBRBRRBRRRRBRRRBBBRRBRBRBBRRRBBBRBBBBRBBRRBB
RRRBRRBBRBBBRBRBRBRRRRBBRRBBBRBBBRRRRBBBRBRBBRRBRRBRBBBBRRRRRBBRRBRBBR
RRBR...

result:

ok ok (1000 test cases)

Test #49:

score: 0
Accepted
time: 144ms
memory: 4156kb

input:

1000
19 110
10 12
8 7
2 17
4 11
6 12
14 13
3 11
3 4
15 18
15 10
2 14
4 16
6 7
19 2
13 16
4 15
9 3
15 3
10 1
12 15
8 14
12 9
12 19
18 4
7 17
10 17
7 15
12 3
14 7
16 9
18 14
5 7
15 9
11 19
4 8
16 11
8 10
4 19
9 8
1 17
3 17
10 7
9 2
2 4
6 18
17 11
5 13
12 16
3 13
10 3
6 5
5 9
1 14
9 19
4 5
11 10
5 19
8...

output:

RBBRBBBRRRRBRBRBRBBRRBRBRBBBBBRRBBRRBRRRBRRRBRBBRRRRBBBBBBRRRRBRRBBRRRRBRBRBBRRBRBBRRRBBRBRBBRRBRBBRBBRBBBBRRR
RBRRBBBRRBBBBRRRRBRRBBBRBBBBRRRRRRRRBBRBRBRBBBRBRRRBBRRRBBBBRRBRRBBRBRRRRBRRBBBBRBBRRRRBBBBRRBRRBRRBBBRBRBRBBRRRRBRRBBRBBBBRRBRBBRRBB
RBBRBRBBRRBRRRRBRBBRBRRBRBBBRRBBRRBRRBBRRRBBRRRBBBRBRRR...

result:

ok ok (1000 test cases)

Test #50:

score: 0
Accepted
time: 118ms
memory: 4016kb

input:

1000
20 108
18 5
11 4
14 5
19 11
5 17
3 2
11 3
14 11
8 4
4 9
3 12
15 10
2 9
12 1
11 18
6 17
19 8
17 3
2 10
14 12
17 4
4 7
10 18
7 3
20 19
12 11
1 15
19 12
1 16
14 16
6 1
13 20
10 17
3 14
7 15
19 14
2 20
6 10
13 12
2 16
1 20
13 5
6 19
2 1
6 20
19 2
4 3
14 17
3 19
15 18
9 5
5 7
4 18
7 9
9 6
1 5
1 8
2 ...

output:

RRBBBBRBBBRBRBBRRBRRRBBBRRRBBRBBRBRRBRBRRRBRBBRBRRBRRRRBRRRRBBRRRBRBBBBBRBRRBRBRRRRBRBRBBRBRBBBBBBRBBRRBRBRR
IMPOSSIBLE
BRBBRRBRBBRBRRBRBBBBRRRRRBBRBBRBBBBRBRBRRRRRBRBBBRRBRBRBBBRRRRRBBBRRRRBRBBBRRRBRRBRRRBRBRBBBRBRRBRRRRBBRRBRBBBRBBBRBR
RRBBBRBRRBBRBRRBBRRRBBRRRRBBBRBBBBRBRRRRRBRBRRRBRBRBBBRBBBRBRR...

result:

ok ok (1000 test cases)

Test #51:

score: 0
Accepted
time: 139ms
memory: 4072kb

input:

1000
20 98
10 7
12 16
5 9
3 13
17 1
7 17
7 13
18 20
8 9
12 10
6 16
18 10
17 12
1 5
14 3
15 5
10 13
8 4
16 20
19 4
10 14
9 2
10 15
15 18
7 1
15 4
6 8
1 16
13 11
19 2
2 5
12 4
12 2
11 18
11 7
9 12
3 15
19 3
15 7
12 15
6 13
11 10
3 9
8 18
11 8
9 6
1 8
17 6
13 2
8 10
8 17
4 7
20 15
7 2
13 20
8 2
7 14
15...

output:

BBRBBRRRRRRRBRRRRRBBBBBBBRBRBRBBRRRRRBBBBBBBBBBRRRRRBBRBBRRRRRBBBRRBRBRRBBBBRRBRRBRBRBRRRRRBRRBBBR
BBRRRRBBBBRBBRRRRRRBBBRRBBBRRBBBRBRBRBRRBRBRBRBBRBBRRRRRRRBBRRBBBBRRRRBBRRRB
BBBRRRRBRRRBRRRBRRBRBBBRBBRRBBRBRRRBBRRBBBRRRBRRBBBRBRBB
RRBRBBBRBBRRRRRBBRBBBBBBRBRRRRRBRBBRRRBRBRBRR
RRRRBBRBBRRRBRBBRRBRR...

result:

ok ok (1000 test cases)

Test #52:

score: 0
Accepted
time: 133ms
memory: 4208kb

input:

1000
21 110
5 8
2 3
10 18
5 18
20 18
21 14
16 3
15 13
3 13
2 14
2 20
18 4
14 4
10 17
18 12
9 6
16 2
8 16
9 7
12 20
10 9
4 7
18 21
1 11
13 17
21 4
19 7
8 21
20 7
2 19
9 13
4 19
4 2
12 3
20 13
14 15
10 20
9 14
16 9
3 15
19 5
12 17
6 21
18 2
12 19
12 7
10 13
21 13
18 15
9 5
3 11
1 9
12 16
11 13
20 3
10...

output:

BBBRRBBRRRBBRRBRRRBRRRRBBRRBRRBBBRBBBRBBBBBBRBRRRRRBRBBBRRBRRRBBRBBRRBRRRRBBBRBBBRBRRBRBRBRBBRBBRRRRRBRBRRBRRR
BBBRRRRRBBBRRBRRRBRBBBBRRBBRBBRRBRBRRBRBBBRRRBBRBRRBRRB
RBBRRRBBRBRRBBRRRBRRBBRBBBRRBBRBBBBRRBRBRBRBRRBRBRR
RRRBRRBBRBBRBRBBRRBRBBBRRBRRBRRBRRBBBBRRBBRRBRRBRBBRRRBBBBBRRRBBBRBBRRRRRBRRBRBRB...

result:

ok ok (1000 test cases)

Test #53:

score: 0
Accepted
time: 114ms
memory: 4156kb

input:

1000
21 138
10 15
9 1
6 19
17 3
12 18
20 9
6 2
12 3
5 15
14 6
8 17
10 9
3 1
17 21
13 17
14 10
11 17
16 11
10 18
12 6
11 4
15 16
11 14
18 11
19 8
7 6
7 19
21 2
7 10
5 17
3 6
13 9
14 13
2 18
13 3
2 5
20 19
13 16
12 20
12 9
14 2
21 13
13 11
2 15
16 2
19 2
6 21
5 20
16 12
12 15
21 9
12 1
21 12
8 2
15 17...

output:

RBRRRRBBBBBBRBBRRBBBRRRBRRBRBRRRBRRRBRRRRBBBBRRBBRBBRBBRRBRBBRBRBRBRRBRRRBRBRBBRBBBBBBBRBRRRRRBRRRRBBRBBRBRBRBBBRRBBRRRRBBRBBRRBBRRRRRBBBB
RBRRBRBBRRBBRRRBRRRBBBRRBBRBRBBRBRRBBBRBBBRRRBRBRBBRRBBBBRRRBRRRRRBBBBRRRBBRRRRRRBBBBBRRBRBRRBBRRRRRBBBRBRBBRRBRRBBRBRBBBBRRR
RBRBRRRRRBBBBRBBBRBRBBRBRR
RBBBRRRB...

result:

ok ok (1000 test cases)

Test #54:

score: 0
Accepted
time: 132ms
memory: 4156kb

input:

1000
22 148
13 17
10 1
3 17
2 15
9 2
11 14
8 11
9 7
2 12
7 17
16 18
9 4
13 3
16 4
14 4
14 7
1 11
2 16
13 14
4 10
16 17
21 8
12 18
8 2
15 3
10 22
4 19
10 11
2 13
13 21
19 14
21 1
8 20
13 19
6 19
21 3
17 11
6 15
11 5
22 12
21 18
18 1
7 19
17 1
5 22
3 19
18 22
7 18
4 8
19 21
13 22
17 14
11 20
5 13
8 10...

output:

RBBBRBRRRBRBBBRBBBRRRBBBRBBRRBRRRBRRRBBRRRRBRRBBRBBBBRRBRBBRRBBRBRRRBRRRRBBBBRRBRBBBRBRBBRBRRRBRBBBBBRBRBRBRRRRRBBRBBRBRRBBBRBRBRRRBRRRRBRRRBRRBBBRR
BRBBRBRRRBRBRRRRBRRBBBRBBRBRBBRBRBBRRRBBBRBBBRBRRBBBBRRRRRBRRRBBR
RBRBRBRRBRBBRBRRRRBBRBBRBBBBRRBRBRRRBRBRRBBRRRBRRRBBRBBRRBBRRRBBBRRBBBRRBBBRBRRBBRBRB...

result:

ok ok (1000 test cases)

Test #55:

score: 0
Accepted
time: 174ms
memory: 4092kb

input:

1000
22 76
11 2
20 22
21 7
11 6
21 5
22 15
9 16
11 14
9 17
7 14
8 17
9 11
20 19
19 1
14 4
5 19
16 5
9 2
12 19
21 17
22 16
1 13
5 7
11 4
10 14
4 3
12 16
9 14
8 22
9 7
15 10
21 22
17 18
13 20
3 22
12 9
4 1
4 6
12 2
2 8
8 3
16 10
5 9
6 5
11 20
17 15
21 9
16 15
20 12
14 1
4 13
8 9
6 21
11 22
21 20
8 11
...

output:

RBBBRRRBBRRRRBBRBBBBBRBRRBRRBRBRRRRBRRRBRRBRBRRBBBRBBBBRBBBRBBBBRRRBRRRBBRRB
RBBBBRRRBRBBBRBRRRBBRBRRBRBBBRBBBBBRRBBRBBBRRRRRRBRBRBRBRRBRRBRBRBBBRBRRRRBBRRBRRBRRRRBRRBBBBBBRBBRBBBRRBBR
RBRBBBRRRRRBBBBRBBRBBRBBRBBRRRBRRBBRRBRBRRBRRRRRBBBRRBRRRBBBBBBBRRBRRBRRRRRRRRBBBBBBRRBBBRBBRRBBRRRBRRRRRRBRBRBBRBR...

result:

ok ok (1000 test cases)

Test #56:

score: 0
Accepted
time: 197ms
memory: 4160kb

input:

1000
23 95
21 17
22 4
15 22
9 11
14 8
20 9
3 4
11 20
7 22
22 17
15 4
3 21
18 6
1 11
23 8
23 2
21 7
14 9
7 20
10 5
14 4
19 14
20 21
19 5
22 14
1 23
7 15
5 12
7 11
17 11
18 10
4 17
11 10
18 8
14 11
15 2
22 8
3 2
7 3
3 10
11 21
17 6
16 5
11 16
5 8
15 10
21 13
20 13
17 19
5 22
7 5
3 22
22 13
10 13
1 9
1...

output:

RBRBBBRRRBBBBRRRBRBBRBRRRBRBRRRBBRBBBRBBRRBRRRBRRRBRBBRBRRBBBRRBRRBBBRBRBRBBRBBBBRBBRRBRRRRBRRB
RBRRBBRRRRBRRBBBRRBRRBBRRBBRBBRRBBBRRRBRBBBBBRBBRBRBRBRRRRBBBRBBRBBBRBRRRB
BBRRBRBRRRRRBBBRBBBRRRRRBBRRBBBRBBRRRBBBRBBRBBRRBRBRRRRBBBBRRBBRBBRBBBBBRRBRRRRRRBRRRRRBBBBBRBRRBBRBRBRRBRBBRRRBRRBBRBRRBBBRRBRBB...

result:

ok ok (1000 test cases)

Test #57:

score: 0
Accepted
time: 171ms
memory: 4064kb

input:

1000
23 125
1 10
6 8
10 9
16 23
16 11
11 6
1 18
14 21
13 14
22 4
13 17
20 8
18 19
13 11
18 11
23 15
16 14
5 8
6 7
1 11
22 21
10 16
5 23
18 20
11 12
14 5
16 17
10 8
21 19
9 12
20 16
21 23
4 10
22 7
21 18
19 15
2 11
1 3
3 21
6 19
3 9
14 2
2 5
19 22
22 3
17 14
11 15
4 8
15 17
8 1
10 22
19 5
16 4
16 5
1...

output:

BBRRBRRBRBBRBBRBRRRBRBRBRBBBRBRBRBRRRRBBRBBBRRBRRBRRBBBBRRRRRRBRBRRRBBRRBBBBRRBRBRBBBRRBBBRRBBBBBBBBBBRRRRRRRBBRRBBRRBRBRRBRR
RBBBRBBRRRBBBRBBRBBRRBBRRRRBRBBRRBBRBBBRRRRRRBRRRBRBRBBRBBBBRRBRRRRBRBRBBBBBRRRRRBRBBBBRRRRBRBBBBBBRBBRRRRRBRBBRRRBRRBBBBRBRBBRBRRBBBRRRRRRBRRR
BBBBBRBRRRBBRRRBBRBRBBBRRBBRRB...

result:

ok ok (1000 test cases)

Test #58:

score: 0
Accepted
time: 173ms
memory: 4036kb

input:

1000
24 24
7 1
4 24
4 11
9 3
18 2
5 8
21 19
19 22
15 1
1 16
13 12
14 1
24 20
21 2
14 23
2 4
18 8
14 6
12 9
23 17
10 20
9 8
18 1
4 21
24 75
13 18
5 20
1 10
7 11
19 22
7 24
2 23
14 9
14 18
5 11
6 9
4 20
8 18
21 9
15 12
23 11
1 13
15 17
1 17
3 24
14 12
4 11
14 24
19 1
21 17
15 16
13 21
3 6
22 8
12 1
16...

output:

IMPOSSIBLE
RRBBBRBRBBBBBRBRBRRBRRRRBRRRRBBRRRBRRRBBRBRRBRRBBBRRBBBBRBBRRBBRBRBBRBBRBRB
BBRBRRBRBBRBRRRBBRRRRBBRBRBBRBRBBBBBRRBBRBBRBRRBRRBRBRRBRRRRBBRBBBBRBRRBBRRRRBRRRBRRRBRRRBBBRRBBRBRBBBRBBBBBRRBRBBBRRRRRRBRBRRBBRRBRRBBRBBBBRRRBRBBRB
BBBRRBBRBBRBRRRRRRRRBRRRBBBBBRRBRRBRRBBBBBRRBBRRBBRRRBRBRBBRRRB...

result:

ok ok (1000 test cases)

Test #59:

score: 0
Accepted
time: 141ms
memory: 4212kb

input:

1000
24 75
20 22
6 16
19 14
18 24
22 3
2 24
17 11
15 8
9 12
5 13
5 20
18 10
5 8
7 17
12 14
8 11
5 19
17 22
5 3
14 4
24 5
4 24
14 3
9 23
18 16
12 4
1 17
7 4
15 18
13 14
5 16
2 1
8 23
11 22
10 19
6 3
22 15
15 13
3 10
22 12
2 23
13 4
16 19
14 10
6 7
20 15
17 21
19 9
8 4
11 5
15 7
21 14
17 4
17 15
9 18
...

output:

RBBRBBBRBRBBBRRRRRBRRBRRRRBBBBRRBRRRBRRBBBBBRBBBBBRRRBRRBBBRRRRBBRBBRBRRRBR
RRRBBRBRRRBRBRBBRRRBBRBRBRBRBBBRRBBRRBBRBRRRBRBRBRBBBBBRRBRBRBRBBBRBRRRRBRBRBBBRBRRBRRBBRBRBBRBRRBRRBBBRRRBBBRRRRBRBBBBBBRRRRRBRBRRRBRBRRBRBRRBBRRB
RBRRBBRBBRBRRRBBRBRBRBBRBRRRBBBBRRRRRRBRRBRRBRBRRBBBBBRBBRBRRRBRBRBRRRRRBBBB...

result:

ok ok (1000 test cases)

Test #60:

score: 0
Accepted
time: 124ms
memory: 4152kb

input:

1000
25 61
25 3
8 15
7 11
11 12
20 17
23 11
24 23
22 21
22 6
2 5
19 9
22 3
11 15
23 1
7 8
7 22
5 24
25 14
23 9
6 14
23 4
13 9
20 23
9 12
3 14
18 2
11 13
9 8
4 15
20 11
23 8
14 9
3 17
9 11
21 17
7 10
4 8
18 19
6 17
14 10
13 7
1 25
16 9
12 10
3 5
14 18
15 1
17 5
22 25
4 21
13 12
5 6
6 7
5 20
13 15
15 ...

output:

BRRRBBBBRBRBBRBBRRRBBRRBRRBBRRRBRBRBRBBRRBRRRBBRRBBRBBBBRBRBR
RBBRBRBBRBBRRRBRRRRRBBRRBBRRBBBBRRRRBRBRBRRRRBRBRBBBRRBRRBBBBBRRRRBBRBBRRRBBRBBBBBRBRRRBRBRRRRBRBBRBRBBRBRRBRRRBRRBRBBRBBRBBRBBRRRB
BRRBBRRRRBBRBBRBRBRRBRBBRBRBRRBRRRBRBRBBBBBBBBRRRRBBBRRBRRR
RRRRRBBRBBBBRRBBRRBBRRRBBBRRBRRRRRBBBRRBBRRBBB...

result:

ok ok (1000 test cases)

Test #61:

score: 0
Accepted
time: 163ms
memory: 4200kb

input:

1000
25 96
24 20
5 8
23 6
13 14
5 6
1 23
3 12
21 12
11 25
12 20
18 5
22 17
21 3
8 20
23 3
21 19
21 1
7 21
15 17
9 11
6 20
2 9
22 9
4 21
3 14
18 12
16 3
25 19
25 3
10 11
19 17
7 17
15 24
25 24
6 12
13 7
21 10
15 21
10 16
25 16
1 18
24 8
20 16
22 1
1 12
1 4
1 24
8 14
14 1
15 16
6 11
9 6
19 3
12 11
25 ...

output:

RRRRBBRBRBRBBBRRRRRBRRRBBRRBBRRBBRRBRBBRBRBBRRBBRRBBBBBRBRBRBRRRBBRRBBRBBRRRBBRRBRBBBRRRBRBRRBRB
RBBRBBBBBBRRBRBRRRBRRRRRRBBRBBRBBRRBRRBRBRRBRBBRRBRBRBBRRRRBBRRBRRRBRBBRBBBBBBBRRBRRBRBRBRBRBB
RBBRBBBBRBRRRBBRRRBRRBRBBBBRRBRBBBRRRBRBRBRRRBRRBBBRBBBRRRBRRBRBRRRRRBBBRRRRBRRBBRRBBBBBRBRBBBBRBBRRRBBRRBRR...

result:

ok ok (1000 test cases)

Test #62:

score: 0
Accepted
time: 187ms
memory: 4072kb

input:

1000
26 134
1 2
25 8
12 8
21 7
15 16
19 11
24 16
12 18
20 16
15 1
14 19
15 25
15 2
15 12
11 18
12 5
10 1
19 17
2 22
22 17
5 18
4 21
26 13
14 26
21 8
24 7
8 26
24 19
7 22
25 19
8 2
21 11
14 3
14 11
19 10
23 7
6 13
17 9
17 5
17 21
9 5
5 20
13 8
10 23
14 6
11 10
4 10
8 9
13 17
4 17
3 16
6 24
12 10
26 2...

output:

RBRRBBRBRRBRRBRRBRRBBBRBRBRRBBBBRRRRBBRRRBRBRBRBBBBBBBRBRBRRRRRRRRBRBRRRBBRBBRBRBRRBRRBBRRBBRBBBRBBBBBBBRRBBRRRRRRRBRBBBBBBRBBBBRRRRBR
RRRRRBBBBRBBRRBBRBRBRRBBRBRBRBRBBBRBBRBBRBBBBRRBRRRRBRRRBRRBBRBBRRRRBRBBBRRBRBBRBRRRRBRBBBRRRBBBBRBRRBRRBRRRBRBBRBRBBBRBRBRB
BRBRBBRRRRRBRRRRRRBBBBRRBBBRBBB
RBBBBRRR...

result:

ok ok (1000 test cases)

Test #63:

score: 0
Accepted
time: 167ms
memory: 4152kb

input:

1000
26 81
6 5
21 15
23 22
26 8
6 12
17 22
3 22
19 26
13 1
18 11
22 14
7 10
8 12
11 3
11 17
6 2
9 14
11 26
19 4
16 22
21 19
18 15
21 7
12 7
26 21
23 26
22 21
17 1
17 9
22 13
15 11
8 23
2 7
4 3
8 20
25 14
8 3
13 12
13 5
2 10
17 7
5 14
22 24
20 24
1 11
16 4
6 13
20 1
6 16
18 14
1 3
8 4
13 2
20 3
15 16...

output:

RBBBBBRBBBRRRRRRBRRBRRRBRRBBRRBRBBBBRRBBBRRRRRBRBRRBRBRBBRRBBBRBRBRRRBBRRBRBBBRRR
BBBRBBBRRBRBBRRRRBBRRRBBRRRRRBBRRBRRBRRBBBRRBRBRRRBRRBBBRRBBRRBBRRRBBRRBBRBBBBRBRRBBRBRBBBRRBRRRBBBRBRRRRRBBBBBBRRBRRRBRRRBBRBBBBBBBRRBBRBRRB
BRRRRBRRRBRBRBBBRBRRBBBRRBBBBRRRRRRRBRBBBRBB
BRBBBBRRBRRRBRRBRBRRBRBRBBRBRRB...

result:

ok ok (1000 test cases)

Test #64:

score: 0
Accepted
time: 299ms
memory: 3996kb

input:

1000
27 146
20 1
20 21
1 6
15 17
2 16
4 15
27 12
20 8
23 1
14 12
13 14
8 18
3 27
2 18
14 4
15 23
19 27
10 9
20 17
16 14
23 7
2 21
10 25
9 22
25 1
8 5
8 21
25 20
1 10
18 12
21 18
27 25
16 4
22 5
3 15
15 24
20 15
18 6
8 17
10 14
4 21
18 27
25 18
8 13
18 26
7 15
5 10
16 8
10 3
26 4
23 5
20 3
24 26
1 18...

output:

BRRRRBBRBRBBRRRRBRBBRBBBRBBBBRRRRRBBRBRRBRBRBRRBBBBRRBBBRRRBRRRRBRBBBRBRRBBRBRRBBBBRBRRBRBRRRRRBRBBRBRBBRRRBBBRRRRRBBBBRRRBBBRBBRBBRBBRRBRRRRRRBBR
RRBRRBBBBRBRBBRRRBRBRBRBBRBRBRRRBBBRBRRBRBBRRBRRBRRBRBRRBBRBBRRRRBRBRBRBRRBBBBRRRBRBBRBBRBRRRBBBRBBBRBRBRRBBBRBRBRRRBRRRBBBRRBBBB
BBBRRRRRRRRBBBBRBBRBRBB...

result:

ok ok (1000 test cases)

Test #65:

score: 0
Accepted
time: 247ms
memory: 4072kb

input:

1000
27 112
12 14
19 3
5 22
27 6
22 19
15 6
19 2
6 5
24 14
13 6
25 2
9 7
27 12
13 10
2 16
23 18
3 22
24 5
14 25
23 3
8 21
20 4
1 22
3 18
13 14
25 19
11 1
13 5
17 25
2 14
21 24
8 19
6 25
9 26
7 21
18 7
12 4
5 18
15 25
12 21
27 20
17 5
19 16
5 27
23 19
20 8
27 23
8 27
26 11
25 26
25 13
26 27
13 16
19 ...

output:

RRBRRRBRBBRRBBBRRRBBRBRBRBBRRRRBBBBBRBBBRRRBRBBRRRBBBBRRRRRBRBBRRRBRBRBRBBBBRRRBRRBBRRRBBRRBRBBRBBBBRBBBRBRBBBRR
RBBBRBBBBRRBRRBRBBBBRBBRBRBRBBBBRRBRRRBRBBBRRBBBRRRRBRRBRRRBRBRRRRRBRBRBRRBRRBRRRBBBRRBR
BBRBRBRRRBRBBRBRBRRRRRRRBRRRRRBRR
BBBRBRRBBRBBRBRRBBRBRRRRBBRBBBRBRBBRRRBBRRBRRBRRBRRRBRBBBRRBBRRB...

result:

ok ok (1000 test cases)

Test #66:

score: 0
Accepted
time: 183ms
memory: 4076kb

input:

1000
28 92
20 18
17 12
22 6
6 3
5 19
17 26
2 27
28 20
5 2
9 10
20 13
26 10
21 17
7 24
1 17
12 9
13 7
26 18
28 9
19 24
6 13
18 10
24 27
14 19
24 1
13 8
3 7
25 28
7 9
27 9
17 16
4 17
23 4
6 20
3 21
17 2
22 9
26 28
5 13
9 17
26 14
22 23
11 5
27 1
21 4
20 2
6 4
12 7
2 12
24 8
13 12
3 26
11 22
26 2
16 20...

output:

BRBBBBRBRRRBRRRBBRBRRBBBBRRRBRBRBRBBRRBBRRRBRBBRRBBRBBRBRRRBRBRRBBRBRBBBRBBBBBRBRRBBRBRRRRRR
BRBBRRBBRBRRRBBRBRRBRRRRRBBRBRBRRBRBBRBRBBRBRBRRRBRBBBRBRRBRRBBBBRRRBBRRRBBBRBRRRRBBBRRRRBBRBRBBBRRBRRBBBBRBRBRBRRRRBRRBBBBBBRRRR
BBRBRRRBRRRBBBBRBBRRRBRRRBBRRRRBBRRBRBBBRBRRRBRRBRBRBRRRBRRRBB
BRRBBBRRBRRBBR...

result:

ok ok (1000 test cases)

Test #67:

score: 0
Accepted
time: 230ms
memory: 4208kb

input:

1000
28 95
25 26
5 23
25 21
20 6
28 4
25 10
27 25
8 9
27 13
3 24
11 21
6 26
1 13
1 26
17 11
9 4
7 26
18 22
18 25
13 11
12 18
8 23
28 14
26 28
15 23
11 8
20 5
22 20
19 25
16 12
22 10
12 10
6 22
20 8
28 15
19 13
22 4
2 21
1 21
23 26
9 23
17 9
24 27
11 3
11 27
24 11
6 25
13 28
14 3
12 3
17 12
1 4
9 18
...

output:

RRBRRRBRRBRBBRBBBRBRRBBRRBBBRBBRRRBBRBRBBRRRBBBBRBRRBBRRBBRBRRBBBRRBRRBBRBRBBRBBBRBBRRBRBRRBRRB
RRBBBRRRBBRBRRBRRRRBBRRRBBBBBRR
RRBBBBRRRRRBBRBRBRBBRBRRRBRBRBBRBBBBBRRBRBRBRBRRBBBRBBRRRRRRRRRBRRRRRBRRBRBBBRBBBRBRRBRBRRBBRBBRRBRBBBBRB
RRRRBBBBBBBRRRRRBRBRBBRBRBBBRRBRRBRRRRBBRRBBRBRRRBBBBBRRRRRRRBBRRB...

result:

ok ok (1000 test cases)

Test #68:

score: 0
Accepted
time: 241ms
memory: 4072kb

input:

1000
29 70
8 26
20 4
16 8
8 5
23 9
18 13
28 11
21 14
20 9
11 23
2 8
25 5
18 15
11 16
25 19
1 16
20 15
29 26
9 27
8 19
1 24
16 13
26 12
6 28
7 24
1 7
8 9
29 14
8 4
28 24
17 8
24 27
16 26
3 21
28 12
17 19
22 4
22 1
13 19
10 4
1 21
8 29
17 2
25 14
8 27
10 28
10 24
14 6
14 27
2 26
12 8
18 24
17 24
10 14...

output:

BBRRRRBRRBBBBRBBRRRRBBRRBRBBRRBRBRBBBRBRRBRRRBBBBBRRRRBRRBRRRRBRBBBRRR
RRBBRRBBRBRBRRRRBRBBRBBRBBRRRRR
BBBBBBBRRBBRRRBRBRRRRRBRRBRRRBBBBBRRBRRBBBRBRBBBBRBRBRRBRBRRRBBRRBBRRRRRBBRBRRBBRRBBBRBRRBRBRBBRBRBRBBRBRRRRBRRRBBBRBRRBRRRRB
RRBBRBRRBRRBBRBBRBBBRRBBBRBRRRBBRBRRRBBBBRBBRRR
BRBRRRRBRBRRBRBBRBBRRBB...

result:

ok ok (1000 test cases)

Test #69:

score: 0
Accepted
time: 228ms
memory: 4152kb

input:

1000
29 109
2 19
14 13
28 1
16 14
8 12
26 22
1 29
4 27
22 7
21 20
5 27
6 27
25 6
20 11
9 15
15 26
21 26
8 17
9 19
11 24
1 4
10 16
7 27
24 26
18 5
9 5
23 12
1 25
23 6
18 20
7 9
19 6
19 16
9 23
10 14
13 8
17 14
23 5
19 8
8 2
11 10
2 17
3 17
5 8
7 18
6 14
21 25
10 9
4 5
27 26
28 17
21 9
16 17
19 25
11 ...

output:

BRBBRBRRRBRBRRBRRBRRRRBBRBBRRBBBRRBBRRRRBBRBRBRRBBRBBBBBBRBBBBRBRBBRRBRRRRBBRRRRRBBBRBRRBBRBRBBRRRRBRRBRRRRBB
BRBBRRBRBRBBBBRRRRRBRBRRRRBBRRRBRBBBRRRRBR
RBBRBRBRRBRRRRBBRRBRBRBRBBRRBBBRRBRBRRBRBRBBBRRBBRBBBBRRRRRBBRRRRBBRBBBBBBRBRRRRRBRBBBRRRRBRRBRBRBRBRR
RBBBRBRRRRRRBBBBRRRRRBBRBRBRRBBBRBRBRBRRBRRR...

result:

ok ok (1000 test cases)

Test #70:

score: 0
Accepted
time: 266ms
memory: 4076kb

input:

1000
30 80
11 22
7 13
18 26
20 8
25 29
4 21
11 28
28 9
6 18
24 26
15 25
28 5
11 16
3 30
9 4
19 5
14 17
15 22
21 26
26 12
1 20
24 30
13 25
25 8
5 30
10 6
8 4
22 28
5 11
2 30
17 16
30 8
22 29
18 12
19 10
4 30
6 14
7 29
18 2
16 5
12 29
9 14
7 20
5 27
18 1
8 5
6 23
8 23
20 5
19 23
25 27
5 26
11 6
21 10
...

output:

BBRRRRBRRBBBRRBRRRBRRRRBBRRRRBBRBBBBBRRRBRBBRBRBBBRBBRBBRRBBBRBBRBBBRBRRBRBRRRRB
BRRRBRBRBRBBRRRRBBBBBRRBRRRRBRRBRRBRBRRBR
BBBRRRBBBRBRBRBRBRBRRRBBRBRRRRRBBBBBBBRBRRBRRBRBBBRRRBBBRRRBRRRRRRRRBBBBRRRRBRBRBB
BBBRBRRBRRRRBBBRRRBBBBBRRBRBBRRRRBRRRRRRRRBRRRRBBBRBRBBRBRBRBRRRBBBBBRBRBRBRRRRBBBBBBRRBRR
RRR...

result:

ok ok (1000 test cases)

Test #71:

score: 0
Accepted
time: 255ms
memory: 4068kb

input:

1000
30 53
22 25
6 1
8 21
27 30
1 8
2 8
28 8
6 28
25 16
28 2
18 14
5 2
27 25
28 23
24 13
15 16
28 17
25 9
19 24
25 20
10 7
9 13
1 2
2 10
26 28
4 29
29 13
17 7
26 4
6 5
26 6
16 6
25 26
24 2
5 11
21 9
19 1
28 24
25 1
26 23
18 26
10 4
3 13
9 12
25 10
5 21
13 17
25 7
28 19
12 10
15 4
16 10
29 6
30 49
2 ...

output:

BBRBRRBRBRRBRBRRRRBRRRRBBRBBRRBBRRRBRBBRBBBBRRBBBRBRR
RRRRBRBBRBRRRBRRRBRRBRRBBBRBBRBBRBBRRBBBRBRBBBBRB
RRBRBBRRBBRBRRRBBBBRBBRRRBRRRRRRBBRBBBRBBRRBRRBRBBRBBRRRRBBBRRBBBBBRRRRBRRBRBBRRRRRRBBBRBRBBRBRBBBBBRBRRRBRRBBBRRRBRRRRRBRBBBBRRRBBBBRRRRBRBBRRRRRR
RBBBBBRRRRBBBRRBRRRRBBRRBRBBBBBBRRRRBRRBBRRBBBRR...

result:

ok ok (1000 test cases)

Test #72:

score: 0
Accepted
time: 265ms
memory: 4156kb

input:

1000
31 145
17 16
31 1
26 31
4 23
10 19
7 5
8 25
25 22
14 31
19 15
11 23
12 22
8 26
16 3
28 25
28 20
23 26
14 11
30 18
23 12
24 9
22 28
22 2
5 8
29 12
25 24
23 8
2 29
21 29
31 15
19 18
26 19
20 2
14 16
25 5
26 13
4 19
28 18
14 17
10 31
8 18
17 25
5 16
14 26
29 9
31 16
24 13
29 28
15 20
19 13
25 11
2...

output:

RBRRRRRBRBRRBBRBBBBBRRBBBBBRBRRRRRBRBBBBRRRBBBBRBBBBBRBRRRBRBRRBRBRBRBRRBBRBRBBRRRBBBBRRRRBRRBRRBBRBBRRRRRBRBRBRRBBBBBBRRRRBBRRRBRRRRRRBBBBBRBRRR
BRRRRBBRRRRBBRRBRRBBBBBBBRBRBRRRRRRBRBBBRBRBRRRRRBRBRRBBRRRRRBRBBRBBBBRBBBRR
BRBRRBRBBRBRRBRBRBRBRBRBRRBBBRRRRBBRRBRRBBRBBRBBBBBRBRBRRBRRBBBRRBRBBBRRBRBRR...

result:

ok ok (1000 test cases)

Test #73:

score: 0
Accepted
time: 281ms
memory: 4148kb

input:

1000
31 93
7 9
15 25
27 11
17 26
23 28
5 24
17 24
18 3
24 4
8 21
22 20
23 12
22 14
27 25
6 22
13 29
14 30
28 26
20 18
30 1
6 19
14 13
23 29
21 28
21 1
22 25
25 18
27 20
19 29
25 6
18 14
2 11
22 16
2 12
31 19
19 23
21 24
23 3
2 16
30 15
24 19
16 17
14 29
19 20
25 24
23 5
3 7
9 22
2 10
31 25
13 18
17 ...

output:

RBBRRRBRBBRRBRBRRBBBRBRRRRBBBBRRRBRBRBBRBBBRBBBBRBRRRRRBBRBRBRBRRRBBRBRBRRBBRRBBBRBBBRBRBBRBB
BRRRRRRBBBRRRRBBBBBRBRBBRBBRBRRBBBBBBBRRBRRRBRRRRRRBRBRBRRRRRRBRRRRRBBRBBBBBBRRBBRRBBR
RBBRRBRBRBBBRBBRBBBRBRRRRBRRRRRRRRRRBBBBRRBBRRBBRRBRBRBBBBBBRRRB
BRRBRRRBRBBRBBBRBRBRRRRBRBRBRRBRBRBBBBBRRRBBBRBBBRRRRB...

result:

ok ok (1000 test cases)

Test #74:

score: 0
Accepted
time: 263ms
memory: 4200kb

input:

1000
32 51
29 15
16 3
18 16
24 9
24 7
7 19
18 21
13 29
26 25
18 31
10 13
15 10
13 12
1 30
5 7
14 27
9 15
1 32
1 17
4 22
20 1
26 16
6 9
9 27
2 27
4 31
28 19
24 31
32 15
12 32
4 28
7 2
30 21
31 21
17 28
24 18
21 27
31 8
20 14
26 30
7 10
11 19
23 32
10 22
16 31
20 8
2 9
14 15
32 28
1 6
25 4
32 41
17 29...

output:

BBRBRBBRRBBRBBBRRRBRRBRRRRRBBRBBRRRRBBBRRRRBRRRBBBB
BRRBRBBRRRRBRRRBRBBRBRBBRRRBBRBRRBBRRBBBR
RBBRRRRRRBRRBBBRRBBRBRBRRBBRRBBBBBBRBRRRRBBBBRRBRBBBRBRBBRBBRRRBBBRRRRBRBRBBRBRBBRRBBRRRRRRRBRRBRRRBBBBBBRBBRRBRRBRBBRBBRBBRRBBRRBRRRRRBBBBBBRBBRBRB
BBRRBRRBRRRRRRBBBRBBBRRRRBBBRRBBBRRRBRBBRRBBRRRBRRBRRRBBR...

result:

ok ok (1000 test cases)

Test #75:

score: -100
Wrong Answer
time: 349ms
memory: 4072kb

input:

1000
32 84
24 7
21 20
6 7
19 7
21 4
3 19
2 1
7 17
18 9
13 20
7 31
30 14
7 28
5 2
24 16
26 7
5 24
32 9
2 17
15 7
28 2
18 29
16 3
6 4
11 15
9 14
20 12
30 19
8 25
23 8
19 4
16 31
17 24
29 8
17 25
24 4
20 22
2 9
27 4
16 26
27 14
24 11
14 2
23 10
1 30
20 24
27 6
6 9
12 24
30 5
13 9
32 11
26 10
32 6
8 28
...

output:

RBBRRBBBRRBBRRBRBRBBBBRRRRRRBBBRRRRRBRBBRBRRRRBRBBBBBRRRBBBRBBBRRRBBRBRBBRRBRBRBRRRR
RBRBBRBRRBBRRBRRBBBBRRRBRRRRRBBRBBBRBBRRRRBRRBBBRBRBBRBBRRBBRBRRBBRRBBBRRRBBBRBRRRRBBRRBRBRRBBRBBBRRRBRRBRBRBBRBRBBBRRRB
BBBRRRBRBRRRBBBRRRRRBRRBBRRRBBBRBBBRBRRRRRRRBRRRBBBBRRBBBBBBBRRBBBRRBRBRRRRBBRBRBRBBRBRBRBBBRB...

result:

wrong answer jury has answer but participant doesn't (test case 715)