QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#360102#5240. Łamigłówka [C]ucup-team233510 ✓134ms10944kbC++143.2kb2024-03-21 11:55:022024-03-21 11:55:04

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 1
Accepted

Test #1:

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

input:

20 20
.BC.BC.....B.B......
.CC.....BBBC.C....C.
.....BB..B.BBC...CB.
.B.........C.BC..C..
.C.CB.B....B.C...CB.
C..C.BBB...CB.B..CC.
.B.CBCB...CC.B....C.
......B....B.C.B.CC.
C.B..CC......C....B.
.....BC......BC..CC.
.BC..CC....B.....C..
.....C.....BBBC...C.
.C.........BBBB..BCC
...CBBB....B.B....B.
...

output:

CCCBBCBCCBCCBBBCCBB.
CCBCCBCBBCBBCCC.....
BBCBCBBCBBBB........
CCCBBCCBBCCC........
CCBBCBBCBBBC........
BBCBCCBBBCBC........
BBBCBBB.............
CCCBCCC.............
BBCBBBC.............
BBCCBCC.............
CBBBBB..............
BCCCB...............
BCCCB...............
CCCB................
BBC......

result:

ok 20 lines

Test #2:

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

input:

5 13
.CCBCB...BC.C
CBBCCC.C.BBBC
BCCBBB.C.CCB.
CB.C.C...CBC.
B.BCCC.C.B.BB
35
GGGPLDPGPLDLPPPDPGLDLPGLDDPDDPGLDPP

output:

..........CBB
....CBCCCCBBB
..CCCCCCCBCCB
..CBBBBBCCBBC
..CCBBCBCBCCB

result:

ok 5 lines

Test #3:

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

input:

1 2
CC
5
LPLLD

output:

CC

result:

ok single line: 'CC'

Test #4:

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

input:

5 6
CBCCC.
C..BBB
.B..B.
BB..B.
B.CCC.
21
DGDDDDGDDDDGGDDDPDDLL

output:

C.....
CB....
CBCB..
BBCBB.
BBCCCB

result:

ok 5 lines

Test #5:

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

input:

12 20
............B.......
..C....C............
B.B..........C...C..
C...B.......BB.C..B.
........B....C......
...........C........
................B...
....C.C...C..C...CC.
.......BB...C.......
........B...........
....................
.C..BB..B...........
98
GGDGGGGDGDDDDDGDGGGDDGGDGGGDDGDGDGGGDGG...

output:

....CCBCCCBBBCCBBCCC
...........CBCCBBCBB
................CBBB
..................BC
....................
....................
....................
....................
....................
....................
....................
....................

result:

ok 12 lines

Test #6:

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

input:

1 19
..C.......C.C......
40
GDDDGGDGDGDDDGDGDDDDDGDGDDDGGGGGGDLDDLDD

output:

CCC................

result:

ok single line: 'CCC................'

Test #7:

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

input:

20 20
...B..BB.C......CBC.
.....BC...B.........
.B......C.BBB..B.C.C
..B.CC...C.......C.B
.BBB..B......B..C.C.
....C..C.B..B.B.C...
B.C.C....B.B..CC..CC
..CBB...C.CBBBB.B...
B..B.....B.BCBB....C
........BB...C......
...B...C..BC.......C
.C.....C.B.C........
B...B...CC..C.BCB.C.
.B..C..CC....CBC....
...

output:

BCBBCBBBCCBCCCCCBBCB
BBCBBBBBCCCBCBBBBBCB
BCCBCCCCBBBBBBBBBBCC
BCBBBCBBCBCCCBBBCCCC
CBBBBBCCCCCBBCBCCC..
BCBCBBCCCCBBCB......
BBBCBCCCCC..........
CBCCCCC.............
BBC.................
....................
....................
....................
....................
....................
.........

result:

ok 20 lines

Test #8:

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

input:

13 19
..BC.B....CBBC.BC..
.C..BC.CB..B..B.BB.
C.B.B...B..B.B..CC.
.C.BC.CBB.CC...CBBC
.CB.B.B.....C.C.BB.
CC....CC..BB.....C.
CCC.C..B.B.CBBCCCB.
CB.C.B.C...BC..BBB.
.BB..BC.B.....CC..B
BB.CBBB.BBBC.CB.CCC
..C.CCBB.C.B.CC..BC
..CBC.......BBC..B.
BB......B...B.C...C
100
GDGGGDDGDDGDDGGGGDDDGGDDGDGGGG...

output:

CCBCBBCCBBCBBCBBCBC
CCBBBCBBBBCBCBCCBCB
CCBCCBCCBCBBBBCCCBC
CCCCBBCBB.BCCCCBBBC
BCBBCBBCB..BBCBCBCC
BBC.BCBBB..CBBC.CB.
.BC.C......B..C.BB.
.B..C......C..C.CC.
.B.........B.....B.
.................B.
...................
...................
...................

result:

ok 13 lines

Test #9:

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

input:

13 16
C..B..B...CBB.CC
...B............
................
................
BBCCCCBBCBCBCCCC
...BB.CCC...CCCB
................
........B.......
..............B.
................
BB.CB.B....C.CCC
BB.CBCCCBCBBBBCB
B..........BB..C
100
PLLLDGLGPGPPDDPLDDGPGPDLDLGGLPDLGPDDDGPLGLLDPLDPDLLGPPDPLPPPDLLLGPDLG...

output:

CCCCBCBBBCBBCCCC
.CBCCCBCCCCCBCBB
.......BBBBCBBCC
.......CBCBBBBBB
........BCCBCBBC
............CBBB
...............C
...............C
...............B
................
................
................
................

result:

ok 13 lines

Subtask #2:

score: 1
Accepted

Test #10:

score: 1
Accepted
time: 3ms
memory: 6380kb

input:

100 100
.C..BB.....BBB.B.C.BC.B..CCC.CB.B.B..C..C.BC...CBBC.B..BC.C.C...BCC.BCCB..CB.CCBC......C.CB.....CCCB
.B.B.C.CC.B...C....CCCC.C.BCCCB..BB.B...C.B...B.C..C....C.CBB.......C.C...B..BBB..C.B.CC....B...BCCB
CB.BCCBB...CC....B.BCB....B.C....BC....BB.BC..C.BBBB....C..CCCC...C.BBCC..BB.C..C.CBCBB..B...

output:

CBCCCBBCBCCCBCBCBCCBBBCCCCBCBCCCBBCBCCCCBCBCCCCCCCBBCCBBCCBCCCBCCBCCBCBBCCBCBBCCBCBBCBCCCBBBCCBBCBBB
CCCCBBBCCBBCCCCCCCCBBBBBCBBCBBBBBCBBBCBCCBCCCBBBCCBBBCBBCBCBBCCCCCBCCBCCCBBBBCCBCBBBCCBBCCBBBCCCBCCB
CBCCBBBCBCCCCCBCBCCBBBBCCCCBCCCCCBBBBBBBBBBBBBBBBBBCBBBBBBBBBBCCCCBCCBBCCBBBBCCCCCBBBCBCBBBCCCBBCB...

result:

ok 100 lines

Test #11:

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

input:

74 32
.C....C...C.B...B.C..B.CCCCB.B.C
BB...C.BC.....B.B.......C.......
CBB....BBCCCBCCBCCB.BBC.CBBC.C.C
BBCBBBCBBCCB.BBCBCBB.CC.CCCCBCCB
CCBCCBBBBBCCCCBBBBCCBBCCCBCBBBB.
CC...CC.CC.B.......B......C..B.C
.CBBCBBBBCC.BB..B.CB.BCCBCCC.BCC
.B...C..........C.....C......B..
CBBBBBB.CCCB.CCBB..C..BBBBCBCB...

output:

................................
................................
................................
................................
...............................B
...............................C
...............................B
.............................BBC
...........................CBBBB
......

result:

ok 74 lines

Test #12:

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

input:

87 10
.BB.CBB...
.CC.BCBBC.
CBBCBCCCB.
BBB.BCB...
..C.CCB..B
.BC.B.B...
.BB.B.CCB.
..C.BCC...
BBC.BB.B..
.BC.BCC...
.BB.BCB.C.
.CC.BC.BC.
.CB.CBC.B.
CCC.B.B.B.
CBB.C.B.C.
.C..BCCB..
.C..BBC...
.CB.B.C...
.CC.BB.CCC
.BB.B...C.
.CC.B.BCB.
C.C..CBBC.
.BC.BBC.B.
.BB.CBCCB.
..C.CC.C..
.BC.BBC.C.
.CB.BCC....

output:

..........
..........
..........
..........
.........B
.........C
.........B
........CC
........BC
........CC
........BB
........CC
........BB
........CB
........BC
........CB
.......CBB
.......CBB
......BCCC
......CBCB
......BCCC
......BBCC
......BBCB
......BCBC
......BBBC
.....BCBBB
.....BBBBB
......

result:

ok 87 lines

Test #13:

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

input:

81 16
..B.............
..CC.B....CC....
CC.CCBB.B......C
BBCB............
CBB.BBC.........
..C.B.C...BB....
.CBCCC......CCB.
.C.BBB....C.....
..B..C....B....C
CCC..CC...C....C
C..CB.B...B..C.B
C.CBCB.C......C.
BC.C.CB...CC..C.
C.BC.C....CC....
B.BC.BB...B...BC
...C.B.....C....
...B.C....CB..B.
..BB....

output:

CCBBBBCCCCBBCBC.
CCCCCBCBCBBCCBB.
CBCBBCCCCCCCCBC.
BCBCCCBCCCCCCBB.
CBCBBCBBCBCCCBC.
CCCBCBCBCBCBBCC.
CCCCBCBCBCBBB...
BBCBCBBBCCCCC...
CBBBCCCCCBBCC...
BBCCCBCCBBBB....
BCCCBCCBBBBB....
CCBCBCBCBBCC....
BCBCCBCCBBBB....
BBCCBCBBBCBB....
BCCBCCCCBCBC....
BCCCCCCCCCBC....
BCBCBCCBBBBC....
BCBBCCCCBCB...

result:

ok 81 lines

Test #14:

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

input:

91 22
..............CC......
......................
............C.........
.....C.....B..........
.......C.....C........
.....................B
.................B..C.
..........C.C.........
....B.................
......B........C......
......................
......................
.................B...

output:

CCCB..................
CBCB..................
CBCB..................
CCB...................
BCB...................
BCB...................
BCB...................
BCB...................
BBC...................
BB....................
BC....................
CC....................
BB....................
C...

result:

ok 91 lines

Test #15:

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

input:

18 73
....BCCC......C.CB..CB.....C...C...........B..BCC.CC.BC.....C..........B.
.C.C....B.B..B...BC....BCBC......C.....C..C....B.C....C.B..BCC...C.B....B
.B.......C............C....C....B.....C....C..C..................B.......
.......B...C.B.......BB.BC........B..CB...CB.C......B.....BC.C......B.B....

output:

BCCBBCBCBCCBCCCBCBCCBBBBBC...............................................
CCBBBCCBCBBBCBBCCBCBBBCB.................................................
BBCCCBCCCBBCCBBCCBCCCCCB.................................................
CCCCCCCBCCBCBBCBCBBCB....................................................
CBBB...

result:

ok 18 lines

Test #16:

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

input:

70 4
C...
....
...C
..B.
B..B
....
..C.
C...
....
....
....
....
....
....
....
....
....
C...
....
....
..B.
..C.
B.B.
...B
.C..
....
....
....
....
....
....
....
....
....
CB..
....
....
....
....
....
....
...B
..C.
...C
....
....
....
....
....
....
....
....
....
..B.
.C..
....
C...
B...
..B.
...

output:

CCCB
CBBB
BBCC
CBCC
.CBC
.BBB
..CB
..CB
..BC
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
....
...

result:

ok 70 lines

Test #17:

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

input:

77 40
BB...CCB.C..B..BB.B.B...CB....CCB.....BB
....C.....B..BBBCC...BB.C.C..BC.B.B.CB.B
.B.CCBC.C..C.C...BC..C.B..CCBC.CB.C.CBB.
C.C.BCC....C..C...BC...BBB.C.B.B.CBBBCB.
.C.C..BB.B.C..B.......CC.B.B.CC....C...C
CBCB.BBB.C.B...B....BCBBB.......BBC..C..
.BCBCCC...CB.C..B.C.CB..BC....B..BC.CC..
B..BCB....

output:

......................BBCCBCBBBBBCBCCBBB
......................CBBBBCCBBCCBCBBCBB
..................BCCBCCCCBCCBCCBCCBCCBB
...................CCBCCCCBCBBBCBBCBBBCB
.........................CCBBBCBCCBBCCCC
.....................CBCBBBBCBBBCBBBBBCC
....................BCBCCCCBCBCCBBCBBCCC
................

result:

ok 77 lines

Test #18:

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

input:

71 77
...........................C.................................................
CB.CB.CB.CB.BCCB..CC..BC..B.......B..B.CBBB.C..B.C..CB.B..B...B.....CC..B.BB.
CCC.CC.BBCB.BCCB.CBCBCCCCCCCB.C.C.CC...BCBCCCCCCCBCBBBCCCC..C.C.B.CCCCC.CCBBC
CCCBBBBBCBBCCCC.BCBC..CB..CB.BCCCCCCCBBCBB.BBCC.CCBBBCCB.BBB...

output:

CCCCCCBBBCCBCCBCBCBBCBCBBBBCCCCCCCBBCCBBCCBCBCCBBCCCCBCCBBCBBCCBBBBCBBBCCBBCC
.BBBCCCBBCCBBBCCCCBCBCBCBCBBCBCCCBCCBCBCBCCBBCCBBBCCCCBBBBBBCBCBCCBCBBBCBBBBB
.BBCBBBBBBCCBCCBCBBCBBBCBBBCCCCCCCBBBCBBBBCCCBBBBBCBBBBCBBCBCCCBBBCBCCCCBBCBC
.....CBCBBCBCBCBBBBCCCCCCBBBCBCCBCBCBCBBBCBCBCCCBCCCCBBBCBBBBCBCCB...

result:

ok 71 lines

Subtask #3:

score: 1
Accepted

Test #19:

score: 1
Accepted
time: 121ms
memory: 9636kb

input:

500 500
BCCC..CBBBC.CC.CC..B.C.C..B...CCCC...C...CCBBC.C..BBB.B...BCCBBB..B.CBC.BCB..BB..B.CC...BC.B..BB.C.BBBCB.B..CCCBC.C.BBB..BC.CCBC.B.BC.BBB..CB..C.CC.BCC.......C..C...CCBB...B.C.C.B.C..C...CCC..CB.BBCCC...CCBB...C....CC..B.CB......C.B.......C..BB.....C.BBB....B........C.....B...CCB.C.B..CCCBCC...

output:

BBCBCCCBBCCBBBCBBBBCCCCCBCBBBBCCCBBBBBCBBBBCCCCBBCBBBCBCBBCCBBCCBBCBCBBBCBBBBCCCCBCBBCBCBBBBBCCBCBCBCBBCBCCCBCCBBBCBCCCBBCCCCCCBCBCBBBBCBBBCBCCCCCCBCCBCCCCBCCBCBBBCBBBBCBBBBBBCCCBCCBCBBCBBCCCBBBBCCBCBBCBCCBCCCCCBCBBCBCCCCCBCCBCCCBCCCCCBCCBCBCBBBBCCBBBBCBCCCCCCBCBBCCBBCBCBBCCCBBBBBBBCCCCCCCBBBCBBBCBC...

result:

ok 500 lines

Test #20:

score: 0
Accepted
time: 8ms
memory: 6580kb

input:

394 74
C.C.B.B....C...B..C..B.CCC...B..BB..BB.BB.C.BC..B..BBB......CB.CB..BBC.B.C
C.B..BB..CC....BC........C....B.CB.....B..C.C.B.BBB..B.....BBB.B...BBC...B
...CC.C....CB..B...BCB..BC..BB...C......C.B.....B.B.BBC...BC.B.BB....B.B.C
..CCB.B....B.C.B.CC.C...C...BCB..B....CCC.C.CC..C...CBBB...B.BC.C..B...

output:

BCBBCCCCCBBCBBBCBCBCBBCBBCCCBBBBBCCCCBBBCCBBBCCCCCBBCBCBCCCCCCBCCBBCBCBBCB
CBCBCBBBBBCCCBBBBBBBCCCBCBBCCBCBBCCBBBBBBBBBBBBBBBCCBBBBCCBCCBCCCCCBCBCBBC
CBCCCCBBCBCCCCCCCCCBBBCBCCCBCCBBCBBCBCBBCCCCBCCBBBCBCBBCCCBBBBBBBBBBCBCBBB
CCCBBBCBBBBCCBCCBCCCCCCCCCBCCCBBCCBCBBCCBBBBCCCCCCCCCBBCCCCBCCBCBCCCCCBBCC
...

result:

ok 394 lines

Test #21:

score: 0
Accepted
time: 3ms
memory: 5976kb

input:

14 445
BB.B.B.BBBCB.CB.CCB.BCCBBC.BCB.CBCCCBBBBBB.B.BB.BCBCCCBBBC.CCB.CBB.CCBBBCBBCBCCCB.B.B.BCBBBCBBBCBCC.CBBCBB..CBBCBBCBBBCBCBB.CBB.CBBBCBBBCCBB.CBCBCCBCCBCBCCBCBB.BCC.C.BBC.CBCCCC.CBCCCBBCBCCBCBBBCBBCCBBBCC.BC..CCBCBB.CBCCBBBBCCC.BCBCCBBBCB.BBB.CCCBBCB.CBCCCCBCC.BCB.BCCBBBCB.CCC..CCCB.CCBBBBCBBB...

output:

...............................................................................................................................................................................................................................................................................................................

result:

ok 14 lines

Test #22:

score: 0
Accepted
time: 3ms
memory: 9056kb

input:

286 79
CBCBCBCBBBCBBBCBBBCBCCCBCCBCCBCBCBBBBCBBCCCBBBBCBBCBCBBCBCCBBCBBCBCBBCBCBCBCCBC
.BB.C.BCBC.B..BCCBB..B.B.CBCC.BCCB.CBCCBC.BB.BC..CCB.C..BB..BC...B..CCBB..C...C
.......................C......................................................B
...C...B..CBBCB.B.C.BB.CB...BCCBBC.B...C.B.C..C.C.BB....

output:

...............................................................................
..............................................................................B
..............................................................................C
...............................................................

result:

ok 286 lines

Test #23:

score: 0
Accepted
time: 3ms
memory: 7292kb

input:

249 116
CCC.BBCCBCBCCBBCCBBCBBBBB.BCCBCCCCCBCBBBBCBCCCBBCCBBBBCCBCBCCBCBCCBBCCCBBBBCBCCCCBCBCBCBBC.C.BBCBCBBCCBBCCCBCCBCB.CC
BCCCCCBBBCCBBBCBBBBBCBBCCBBBCBCBCC.CBBBBBBBCCCBCBCCBBBBB.CCCBC.CBBCCBCC.BCCBBBCBCCCCBBBBCBBCCC.CCBCCCCCBBCCBBCBCCCBB
BCCBBCBBCCBCCBCCBBBCBBBCBCCB.BCCBCBCCBCCCCBBCCCBBBBBCBCBCC...

output:

....................................................................................................................
....................................................................................................................
.....................................................................

result:

ok 249 lines

Test #24:

score: 0
Accepted
time: 4ms
memory: 6124kb

input:

170 394
.B.B...........B..CB.........................C..........C.....C...C.C.....................B.C.....................C..C.......B.C...................................B..B...C....C.........B......C..BB.......C......CB.....C........................C...............C....C......B.C.C........B..........

output:

...............................................................................................................................................................................................................................................................................................................

result:

ok 170 lines

Test #25:

score: 0
Accepted
time: 5ms
memory: 6080kb

input:

368 219
BBC..BCCCCBCCBBBCB.CBCCBCCBBCB.BCBCC..BCBCCCBCCCBC.CCBCCCBCBB.BBC.CB..CBCCCBCCBCCCCCBCCBCBBCCCCCBCCCBBBBC.BCBCBCCBCCC.CBBCCBBC..BBB..CCCBBCC.BBCBBB.CCCCC.C.C.CB.CBCB..CCBBBB.CCCCBBCCBBCCC.B.BBCBCCB.BCBCCCBBCCBCBCCCBC.BC
CCBBB..CCCCBBBBB.CCCCBCBBBBBBCBCCC..B.BCC.CCBBBBB.BBCCCB.CCCC.BBC..CCBCC...

output:

BBCBBBCCCCBCCBBBCBCCBCCBCCBBCBBBCBCCBCBCBCCCBCCCBCBCCBCCCBCBBBBBCCCBCBCBCCCBCCBCCCCCBCCBCBBCCCCCBCCCBBBBCBBCBCBCCBCCCCCBBCCBBCBBBBBBBCCCBBCCBBBCBBBCCCCCCBCCCBCBCCBCBCBCCBBBBBCCCCBBCCBBCCCCBBBBCBCCBBBCBCCCBBCCBCBCCCBCCBC
CCBBBBBCCCCBBBBBBCBCCBCBBBBBBCBCCCBBBBBCCCCCBBBBBBBBCCCBCCCCCBBBCBBCCBCCCBBBCCCB...

result:

ok 368 lines

Test #26:

score: 0
Accepted
time: 6ms
memory: 6432kb

input:

319 225
BBB.B...............B..B...CCBCB.B..C.CB..C.BB.CC...C..CC.CBB....C.....BC.C.CBC.B.CBC.B.BB.B..B..C.C..C.BCBCB..B.C.CBCCCB...BB.B..CB.C...B.CBC..B...CC....C.B...C....B.B..C.C......BBB......C.B.C..C.....BBBB..B.CC......BBC.CCB.
BB.B.BC...B..B.B.BCC..BB.C...BC..B.C.CCB.C..B.CB..B...BCB.B.B....B...

output:

BBBBBBCBBBBCCBBBCBCCBBBBBCBCCBCBCBCCCCCBBCCBBBCCCBBCCBBCCBCBBCBBCCCCCCBBCBCBCBCCBCCBCCBBBBBBBCBBCCCCBCCBBCBCBBBBCCCCBCCCBBCBBBCBCCCBCCCCCBBCBCCBBCBCCCBCCCCCBCBBCCCCCBBBBCCBCCBCBBCBBBBBCCBCCBBCCCBCBBCCBBBBBCCBBCCBBBBBBBBCBCCBC
BBCBCCBCBBBBBCCCBBBCBCBBBBBBBBCBBBCCBCCBCBCBBCCBCCBCCBBCBCBBBBBCCBCCCBCBBC...

result:

ok 319 lines

Test #27:

score: 0
Accepted
time: 38ms
memory: 8224kb

input:

379 328
.CBBB.B.C...BCBC.CBB.BCCC...C..BCBB.C.CB...CCCC.CCC..BBCC...CC....C.B..C......C.C.C..C..B.C...CBBCC.C.C.BCBC...BC...BCBB...C..B..BCB.BB..C...CC...CBBCC..BBB...BBBB..BBB.BC.BB.C...CBB..BCC.B..BB.B...CC...CB.BCCC.C.BC..BB.....CBC.C.CB.CC.C...B....BBCBCC.CB.B...C...BBC...BBC......B..C..CBCBB......

output:

...............................................................................................................................................................................................................................................................................................................

result:

ok 379 lines

Subtask #4:

score: 1
Accepted

Test #28:

score: 1
Accepted
time: 1ms
memory: 5860kb

input:

10 20
........BC.....B....
....C.C..........B.C
.C..C...B..B.....CB.
.C..B.C.BC.C..B.B..B
....C..........BC..B
.C..B...BB....C.C.CB
.B..B.C........B....
.B..B.........BC...B
.B..B...C..B........
....B...B..C..C..B..
10000
DPLGPDLGPDLGPPPDDLGPDLGPDLGPDLGPPDLGGPDLGPDLGPDLGPPPDLGPDLGPDLGPDLGPGDLDGPDLGP...

output:

BBBCBCBBCCCC........
BBCCCBBBBBBC........
BCBBCCCBBBB.........
CCCCBBB.............
CCBC................
BCB.................
B...................
B...................
B...................
....................

result:

ok 10 lines

Test #29:

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

input:

2 16
....BCB.........
B...........C...
5383
GGGDGDDGDGDDDGDGGGDDGDDDDGGDGGDDDDGDDGGDGDGGDDGDGGDDDGGGDDDDGGGDGGDGGGDGGGGDGGGDGDGDDDGDDGGDDDDGDDGGDGDDGGDDDGDDDGDGDDDDDDDGDDGDDDGDGGDGDGGGDDDGGGGGDGDDGGDGGDDGGGGDGGGGGGGGGGDGGGDDGGDGDDDDGDGDGGDDDGGGGGGGDDDDGGDDDGGDGGGGGDGGDGDGGGDDGGGGDGDDDDGDDDDDGGGDGGDG...

output:

................
...........BBCBC

result:

ok 2 lines

Test #30:

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

input:

16 4
..CC
C..C
CBCB
....
C.B.
....
..BC
.C.B
C..B
BB..
CBC.
CC..
.BBB
BB..
CBBC
....
644
PLLLPPPLLLLLLLPPLPLPLLLLPLLLLPLPLPPLPPPPPPLPLPLPPPLLPPLLLPPLLLLLPLLLLLLPLPLLPLPLLLPPPLLPPLPPPLLLPPLLLPPLLLLLPPPLPPPPPLLPLLLLLPLLPLPPPPLPPPPLLPLPLPLLPPPLLLPPLLPLPLPPLPLLPLLLPPPLPPLLPPLLPLPPLLLLPLPPLLLPLPPLLPPLLPP...

output:

BCCC
BCCC
CBC.
BCC.
BC..
CB..
CB..
BB..
BC..
BB..
BB..
BC..
CB..
....
....
....

result:

ok 16 lines

Test #31:

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

input:

10 8
.BC..C.C
.CB....C
.BB...CB
.CB.C..B
..B....B
..C.C..C
BC....BB
..C....C
C.C....B
.BB....B
7444
DDDGGDDGDGDDGGDDGGGDGGDDGGGDDGDGGGGGDGGDGGGDDGDGGGGDDGGDDGDDDDGDGDGGGDGGGGDGGGDGGGGDGDDDDGDGDGGDGGDDDGDDGDGDDGGDDGGGDDDGGDDGGDDDGGDGGDGDDDDDDGDDGGGGDGGDDDGDGGDDGDDDGDGDGGDGDDGGDGGDGDDDGDDGGDGDDDGGGDGD...

output:

.......C
......CC
......BC
......CC
.....CBC
.....BBB
.....CCC
.....BCB
..BCBBCB
.CBBCBBB

result:

ok 10 lines

Test #32:

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

input:

13 10
..........
..........
..........
..........
.B........
..........
..........
..........
..........
..........
.......C..
..........
C.........
7824
LLLPLLPLLPPLLPPPLLPLLLLPLLLPLPPPLPLPPPLPPLPPLLLLPLPLLLPPPLPLLLLPPPLLLPPLPLLLLLPPLLPLLLPLPLPPPPLLPPPPLPPPPLPLPLPLLPLPPPPPLLLLLPPPPLLPPPPPLPLPLPPLLP...

output:

.........B
.........C
.........C
..........
..........
..........
..........
..........
..........
..........
..........
..........
..........

result:

ok 13 lines

Test #33:

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

input:

8 15
C..BCC.BC.CC.BC
B..BCCBC...B..C
CC.BCCC.B.C.CBC
...CBC.BBC..BCB
BB..CBCC..CCBB.
CCBB.BC.C.BCB.C
..CBC.C..C..B.C
C...C.BB.BCCCBB
6728
GGDDDGGDDGDGGGDGGDGGDDGDGDGDDDDGGGDGGGDDDDGDGDDGGDDDGGDDDDDGDDGDGDGDDGDDGGGGDDGDDDDGGGGGDDDGDGDDGDDDGGDDDDDGDGGDDGGDGDDDDGGGGDGDDGDGDDGDDDGGDGDGGGGGDGDDDDDGDGGGGD...

output:

CCCBBBCBCCBCCBC
BCCBCBBCCCCBCCC
.CCCCCCCCBCCBBC
...BBBCCBBBCBCB
....BCCCCBCBCBB
........BCCBBCB
.............BC
...............

result:

ok 8 lines

Test #34:

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

input:

14 1
.
C
.
.
.
B
.
C
.
.
.
.
.
.
8337
PPPLPPPPLPPPPLPPPPPLPLPPLLPLPPLLPPLPLLPLLLLLLPLPLPPPPLLPPPLPPLLPPLLLPPLPPLPLLLLLPPPPPLLLPPPLPLLLLPLPLPLPLLPPLLLPLPLLPPPLPPLPPPLPPLLPPLLLPPPPLPLPPPPPPPPLLLPLPPLPPLPPPLPPLLPLPPPPPPLLLLLPLLPLPLLPLLLLPLLLLLLPPPLPLPPPPLLPLLLPLPPLLPLPPLLPLLPPLPPPPPLLLPLLPPLLLLPLPLLLLP...

output:

.
.
.
.
.
.
.
.
.
.
.
C
B
C

result:

ok 14 lines

Test #35:

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

input:

10 12
..B...B.C.BB
.B....CC.BC.
BC....C..CB.
....BB...B..
CBCBCB.BCC.C
CC.C.C.C.B..
......BBC..B
.CBB..CB.BB.
.BCC.B...BCC
..CCCBBB.B.C
10000
GDDDDGGDGGGGDDGGDDGGGGDGDGGDGGGGGGDDDGGGGGDGGGDDGDDDGDDDDGGDDDGDGGDDDGDGDGGDDDDDDDDGDGDGGDGGGGDGDDGGDGGGDGGDGDGDGGDGDDDGGDGDGGGGGDGDDDGGGGGDGDDGDDGDDDDGDGDGDG...

output:

............
............
.........B..
.........C..
.B....BC.B..
.CBB.BCB.CBB
.BCC.BCC.BCC
BCBBBCBBCBBB
CCCCCBCBCBBC
CBCCCBBBCBCC

result:

ok 10 lines

Test #36:

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

input:

7 18
.CB....B.BC......B
BCC..B.B......C...
BC.....C.CB.C.CC.B
BBB..BC..CC.B.CB..
C.....BB.CB...BC.C
CCB..B.C..C.C....C
BBB...BB.BC...CC.C
10000
GGGDPLGPGGDLGGPDDLGGPDLGLPDLDGPGGDDPDLLGGPDLDGPDLGLGPPPDLGPGDDPGDPLGGPGDLDGGGGPPLGPGPPGDDDPLGPPPDLGPGDDPLLLGDDPPLGLPDLGPDLDLLGLGPGPGGDLGPDLLLDLDLGPPDLLGPDLG...

output:

..................
..............CBBC
..........CBCBBBBC
.........CCCCBBBBB
......BCCBCBCBCCCB
......CBCCCCCCBCBB
......CBCBBCBBBBCC

result:

ok 7 lines

Subtask #5:

score: 1
Accepted

Test #37:

score: 1
Accepted
time: 11ms
memory: 6920kb

input:

200 200
...C.C.B....CC......CB....C.......B.......BB..B..B.....B..BB..B..C.B.BC..CB............CC....C.C.C..CCCBC..B...B.C...........C..B...B..C..B...........B.B.......CB..B..C.BC..B.C.CB.C..BB..CB.C...C.....
..CC.BBBB....B....BB.C....BBC...BCC....B.....BC....C.B......B.........C.......CC..CCBCB.......

output:

.......................................................................................................................................................................................................C
......................................................................................................

result:

ok 200 lines

Test #38:

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

input:

50 158
CCCCBCCBBCBCB.C.BBCBCBC.BBCBBBBCBCCBBBBBCBBBBCCCBCCCBBBBBBBCBBBBBBBCBBCB.CBBBBCCCCCCCCCCCCCCCCCBCBCBB.BBBBBBCCCCBBBCCCCBBCBCBBC.CCBBCBBCBCB.CBC.CCCBBCBBCBBBBC
................C.B.C........C....B..........C.B.BB....C.................C......BC...................BB.........C........................

output:

..............................................................................................................................................................
................................................................................................................................................

result:

ok 50 lines

Test #39:

score: 0
Accepted
time: 2ms
memory: 6220kb

input:

41 184
CC.B..CC..B.......C.BCBC.....C..CC..B...BC..........B.B.B..B.BB....BCC...BB.....B.C.C.CC.....C.BCC.C...C.CB..CB.B.C.BBCCBBBCCBC.CC...BCC.B.C........BC...B....BCB.....BBB....B.....B...B
CBCCC.CCCCBCC.B.C.CCCCC.B.C..C.CB.B.CC.BC.BBB.CBBC.B.C.BBBC.BBCCCB..BC.C...BCCC.CBC.BCCCCC.C.CC..CBB...CC..B...

output:

....................................................................................................................................................................................CCBB
......................................................................................................................

result:

ok 41 lines

Test #40:

score: 0
Accepted
time: 10ms
memory: 6304kb

input:

200 174
BBBB.BBCBBBBCBCC.B.BC..B..CCB..B.B..BC.BBBCBCBC.B..CCCBBCCC.C....C.CBCCBB.CCCB.BC.BCCCCBBBBC.BCCB.C.B.CCBB.BB.CBCC.CBC.BB.BBCB.BCB..BB..CBCBBBC.CB.BBC.BBCBCBCBBC.C.B.CCCC.BCC
..CCCBCCCBBC...CBCBBCCBBBC..BCBCBBCBCBBCBBCCCCCBCCCBCCC.BCBCBBCCBBBCCB.BBBCCCB.BBBCBCB.BBBCC.C.CCCBBB.BBCCCC.C..BBBC....

output:

BBBBCCCCBBBBCBCCBCCCCCCCCCBBCCBBCBBCBCCCCCCCBCBCBBBCCBBBCCCCBCBBCBBCBCBBBCCBBBBCCBCCCCCCBCCCBCCCCBCCBBBBBBCBCCCBCCCCCCCBBBBCBCBCCBBBCBBCCCBBBCBBBCCCCCBBCBCCBCCCBBBCBBCCCCBBCB
CCBBCBCBCBBBCCBCBCCCBCBBCCCCBBCCBCBCBCBCCBBCCBBCBCBCCBBBBBCCBBCCBBCBBBBCBBCBCBCBBBCBBCBBBCCCCCCCCCCBCBBCCBBCCBCBBCBBCCCBCBCBC...

result:

ok 200 lines

Test #41:

score: 0
Accepted
time: 5ms
memory: 6688kb

input:

133 146
CCB.BCBCCCBBC.BBBBBCBBC.CBBBBCBCCBC.BCB.CCCBBCBCBBC.BCC.CCCCCB.BBCCB.B..CBBCCBCBBBBCCB.CBBCCCBCCBBCCCBBBCCBCBBBCCBCBBBBBBBCCBBC.CBCC.CBBBBB.BCBCBB
CBBBBC.BBCCCBBBCC.CBBBC.BCCBBBCCBCCCBBBCCBBBBC..BCB.CBBCB.BBCCBBBBCCCCB.CCBCBCCCCCBBCCCC.CBCBBCCCC.CCBCBCBBCBBBCBCCBB.BCCBBCCBBBCBBBCCBCBCBCCBCBC...

output:

..............................BBBBCBCBCBBBBBCCBBBBBBBBCBBBCBBBCCBCCCBCBBBBBCBBCBCBBCCCCBCBBBCBCCBBCCBBBBCCCCBBCBBCCCBCCCBCCCBBCBCBBBCCBBCBCCCBBCBB
.........................BBCBBBBCCBBCCCCBCBCCCBCCCCBCCBBCCCBBBCBCBCCCCBCCBBCBBBBCCBCBBBCCCBCBBCCCCBBCCBBCCCCBCBBCCBCBCCBBCCCBCCBBBCBCCCBCBCBBBBBBB
.........

result:

ok 133 lines

Test #42:

score: 0
Accepted
time: 6ms
memory: 6676kb

input:

152 171
....B..C............BC.C..BCC.....C.B......C............CB.B.C.................BC.....C....C..B..............C.C.....C...C..B....B..C..........CBB.......B.CB...C..B.......
......C.B...B.......B.B.C............B.C.C...........CC....C.C...B.C.B.C.............CCC..B..BCC.C.B.B....B.......C.BBCB...

output:

...........................................................................................................................................................................
...................................................................................................................................

result:

ok 152 lines

Test #43:

score: 0
Accepted
time: 3ms
memory: 6072kb

input:

19 144
C..C..C.C.C.CBCB.BBBBB.B...BCCCCBBBCCB...CC.C.CC.CB.BC.C..CCBCBC..CBCBC.C.BCCCBCCBC.BCC.BBB.CBCBCBBCCBB.B..CCBBBCB.BBCCBB.C.BBCBBB.CCCBCBC...CBB
CCC.BC.BCBBBCBB..BCCC.BCCBBC.BCBBCBCCBBBBCC.CCCCBCCB..CBBC.BCBC.CC..CB.CBB.CBBBCBCBBC..CCCCC.BCB.CCCBCB..CCBBBCCBBBC.BCCBCBCCBBBB.BB.BBCCBB.BBC.
B.B...

output:

CCCCBBCBBCBCBBBCBBBBCBBCCBBCBBCCCCCCBCCBBBBCCBCBBBCBCBBBCCBCBCBCCBBCBCCBCBBBBBCBCBCCBCCCCCCCCCBBCBBCCCCCBBBBBCBCCCBCBCBBBCBBCBBBBBBCBBCBBCCBBCCB
CCBCCCBCCCCCBBBCBBCCCCBCCCCBBCCBCCBCCBBCCBCCCCBCBBCBCCBBBCCCBCBBBCBCBCCBBCBCBCCCBBBBCCCBBBCBBBBBBBBCBBBCBBBBCBBBBBCBCBCBBBBCCBBCCCCCBCCCBBBCBBBC
CCBBBBBCCC...

result:

ok 19 lines

Test #44:

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

input:

121 132
C..B...B...C......CB.CBB..B..CBCC...B...CC..BCBC...B...CC..B.B..CC.C...B...CCBBB.C.BCB.BBCBB.....CBB.B..C..B.CB..B.CCBB.CB.CCBBCBB.B
.C.C..B.CB..CCC..CB.B.C.B..CBBB.C...B..CBCC...C..CBCB..CB..BBBB.C.B.B....B.C.C....CBBCB.CBBCB...B..C.C.CCBBCC...B..C.C.B.C..B.CCC..C
...BC...CBB.CBBB...B....CB...

output:

....................................................................................................................................
....................................................................................................................................
.....................................

result:

ok 121 lines

Test #45:

score: 0
Accepted
time: 3ms
memory: 8088kb

input:

191 112
.BCB.BCCCB..CCBC.B....C..BC.CB..B.CBB.C......B.B..C.CC..BC.C...CC.BC..BC..C..CC.C.CBBBCC...CB..B.CC.BB..C...BBC.
.....BB.B...CC.B.....C...C.C.CCBBB.C..BC....CB.B....BB..BC..B..CCCBBC.CB...B..C..CCCB.CCBCBB....CC..BBCB...B.B..
C..BC.BCCB.BCB.BCB..BCB..BB.BC..B..B.BB.CB..BBBC..C..C.BCB.B..BCC....

output:

................................................................................................................
................................................................................................................
.............................................................................

result:

ok 191 lines

Subtask #6:

score: 1
Accepted

Test #46:

score: 1
Accepted
time: 32ms
memory: 8084kb

input:

300 300
BC.CCB.C..C......BC.....BCB..C.BB...CBBCC...BC.BB...B..CBBBB...C.BC....CC.BCCB.CC.B..B.C..BC.....CC.C.B.BCCB.BC..B.B.CB.B.CBB..B....B....BC..BB.B...C.CCB..CBCCB.CC...B.BB.B..B..CC.CCBBC.C.C.B...B.BB.....CCB.CC..BBBCB..CC..CCB.CCB....BC...BCBBCCBCCCBC.BB.....C...CCCB..CB.CBBC.CB..C.C.C.B..C.....

output:

...............................................................................................................................................................................................................................................................................................................

result:

ok 300 lines

Test #47:

score: 0
Accepted
time: 8ms
memory: 6996kb

input:

178 181
B.B.BB....C.CCC.......CCC.B...BB.C....C...B.CC..BCC....CC....C.CBBB...BB....CBB.BB.........CB.B....B........C......BB.B.CC..CB.....C..CB.B..CC.C..BCC.C.BBB....CB.........C....B.C.BB
.............................C........................................................C..........................

output:

.....BBBCCBBCBCBBCCBBCBBBCBCBBBBCBBCBBCBCBBCBBBBBBCCBBBCBCBBCBBCBBBCBBBBCBCCBBBBCBBCBCBBCCBCBBCCCCCBBCCCBBCCBCBCBBBCBBBCBBBBCCBCCBBCBCBCBCCCBBCBCBCCCBBCBCCCBCBBBBCCBCCBCCCCCBBBBCCBC
......BCCCCBCBBBCCBBBCCBBBBCCCBBBBBCCBCBBCCCBBCCCBCBCCBCBCCCCBBCCBCCBBBBBBCCCBBBBBCBBCBCCBCCBBCCCBBCBCCBCBBCBCCCBBBBBB...

result:

ok 178 lines

Test #48:

score: 0
Accepted
time: 6ms
memory: 6548kb

input:

102 35
CB.CCC..C..BB..BC.CCB...C.CCCB.CCCC
CBC..CCB..CCC.C.B.BBC.CBB....BC..BC
CC..BB.B..BCC.BCCB.B...CC...CB.BBB.
......CC..BBC..BB.BBB.C.BC.BCC..CCC
CBC.BBB.CCCC..CBC.CB....B....B..CCB
.B.B.BC.BC.CC..CC..CB.CBCCB.CBB..CC
...CCBB.......BCB..C..C.C..B.B.B.BB
.CBC.CCB.......CC..C.CCCC...CB.B.BC
.B.C....

output:

CCCBBCBBCBBBCCBBBBCCCCBCBBCCBBBCCC.
CCCCCCCCBCCBBCBBBBBBCCBCCCCBCBCCCB.
BCCCCBBBBCBCBCCBBBBBBCBCCCCCCCBBCC.
CBCCBCBCCCBBCBCBBBBBCCCBBCBBBBCBCC.
BCCBBCBCCBCBCCBCCCBBCCCCCCBBBCBBCB.
BBBCBBBCCBCBBCBBBCBBBCCCCBBBCBBCCB.
BCBBCBBCBBBBBBCCCBCCCCBBBCBCCBCBBB.
CBCBCBBCCCCCBCCCCCCCCBCCCCBCBBCBB..
CBCBCBCCBBBC...

result:

ok 102 lines

Test #49:

score: 0
Accepted
time: 11ms
memory: 7000kb

input:

290 119
CCC.B...B..BCBBBCCCBCCC.C..CCBBCC....CCCCCBBBCC.CC..C...B.BB.B.B.B..CC.B..C..BBC..B..CCCCB..BC..CC...BBCBC.....CC...C..
B...CC.BBB.BC..C.BB.BBB.C.BC.B...B...BCB.BBBBBBB.B.CB.BC.BCB.C.B....B.....CB.BCC.B.C..C.CB..BBC.B...BBCCB..C...BB......
C.B.BB..C..C.CCC.C..B.C.BC.C.CC.C.....B.BB..CBCCCCCC...

output:

......................................................................................................................B
......................................................................................................................C
...............................................................

result:

ok 290 lines

Test #50:

score: 0
Accepted
time: 6ms
memory: 7228kb

input:

210 246
C.BBB.C..BCCB..BBC.BBCC.CB.B.C.B.BBB.CC.BBCC.B.BBB..BC.BB.CCC..C.BCBCC...B.BC.C.CBBBBCCB.CBCC..B...CBB.B.CBCC..C..C.CCBCBBB.BBCBBCCCB.C.CBCC.BCB.C....B...B.BCCC..CC.BB.CCCB...CBBBC.BBBCC.B.C.CB.CB.C.B.C..C.CBCCBC....CB.CB..CBBBCBB.CBBBB.CC..CB.B.
.CBBBCCBC.BCB..BBCCB.BCC..CC.C......C.CCBBCBB...

output:

BBCCCBBBBCCCCBBBCCCBBBCBCBBCCBCBCBCCCBBBBBBCBBBBCCBBBCCBBCCCBCCBCCCBCBCCBCCCBBBBCBCCCBBBBCBCBCCBBCBCCCBCBCBCCCCCCBCBCCBBCBCCBCBBBCCCCBCCBBBCCBBCBCBCCCCBCBBBBCCBBBCCBCCCCCBBCCBCCBCBC.................................................................
BCBBCBBCBCCCCCBCCBBBBCCCBCCBCBCBBBCCCCBBBCCBCBCBCCBBC...

result:

ok 210 lines

Test #51:

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

input:

289 18
.CB..CBC..C.C..C..
.CC...CCBB....B...
CC...B.B.B...B.BB.
...BC....C........
.BC..BC.....C.BC..
..BB.B.C.B.B.C....
BBBB.CB...BB.B....
..C..C.C......B..B
.......B.BBBB...B.
.B.....C....CC...C
.B.......C.C.CC..B
.BB..B....C.C.C...
.CC.CB....B.B....C
..B..CB...C..B..C.
C........B...B.B..
CB.B...C...

output:

................CC
................BC
................CB
................BC
................BC
...............CCB
...............CCB
...............CCC
...............BCC
...............CBB
...............BBB
...............CCB
...............BBB
...............CBC
...............CBB
..................

result:

ok 289 lines

Test #52:

score: 0
Accepted
time: 3ms
memory: 6112kb

input:

68 98
....BC.C..C......C..B.B.....B.CC...C.C.....C.....BC.CB..B.C..B.BB....CB.B.CBC.C.C.B...C......BC..C
...BBC....B.B..C....B.....C.B.B.C.B.B..CBCC...C.C..CC..BB.BB.C.B...B...CBC.C............B.C....C.B
..C...BB.B.BC..C.C......B.C..B...BBB......B..BC.CC....CC....B...C...B...B.C...B.B.CBB.BBC.B........

output:

CCCBCBBBCBCBBBCBBBBBCCCBCBBBBBCCCBBBCBCCBCCBBBCCBCCCBBBCCBBCCBCBCBBCBBCBCCBCBCBBBBBCCCBBBCBCCCCCBB
BBCCBBCBCBBCBCCCCBCCBCBCBCCCCBCBBCCBBBBCBCBBCCCBCCCBCCBBCCCCBCBBCCCCCCCCCCBCBCBBBBBCBBCCCBBCCBCBCB
CBCBBBCCBCCCBBBBBCBCCCCBBBCCCBCBBBCBBBCCCBCCCCCCBBCBCCCBBCBCBBBBBCCBBCCCCCBBBCBCBBBCCCBBBBCBBBCCBB
BBC...

result:

ok 68 lines

Test #53:

score: 0
Accepted
time: 16ms
memory: 9268kb

input:

292 171
B..CB.......C.....C..CB.....BCC....B.......C..B..C...B.B........B..B..C...C..B.C.B...CC....BB....C....BC.......BC.........B.C...C...B.....C.BC........BB.....BB..B.B..B...B
.............B....B.B..........C.....C....C......................C......BC.......B...B............B........B.B....B........

output:

BBBCCBCCBCCBBBBCCBBBBBBBCBBBCBBCCCBCCCBCBCBBCCCBBBBCCBCBCBBBCBCCCBBCBBBCCCCCCBBCCBCBCBCCBBCCCCCCBCCBCBCBCCCCCCCBCCCCCBBBCCCCCCCCCCBCCBCCCCBCBCBBBCCCBBBCCCCBBCBCCCBBCBCBBCB
CBBBCBBCBCCBCCBBBCBBCCCBCBBCBBCCCBCBCCBBBBCBBCBBBCBCCBCBBCBBCBCBCCCBCBBCCBBCBCCBBCCCBCBBBBCBBCBCCBBCCCCBCCBBCCBCCBBCCBBBBBBBBBBC...

result:

ok 292 lines

Subtask #7:

score: 1
Accepted

Test #54:

score: 1
Accepted
time: 120ms
memory: 9052kb

input:

500 500
...C..CBBCB....CBBBC....CB.C....BB.CCB.BBB...B.CC.B..CBBC.BCBCC....CBB.C.BCCB.C.C.CB.C.B.BC..B..BCCCB...B.B.B.CCBB.CB....BBCC.CCCC.C...CBB...BB...BBC.C..CBCBCCC.CB..C.CC.CBC.B.C..B....C.CBB......C.BC.BB.C.C..CB..B.C..CB......CCBC...BBB.BB..CC...C....C.B...B.BB.B..CC.B.C.BCBB.B.CC.BCBB.B...BB...

output:

...............................................................................................................................................................................................................................................................................................................

result:

ok 500 lines

Test #55:

score: 0
Accepted
time: 5ms
memory: 8272kb

input:

66 211
..C.....BCC....B.BBB.....B....CB..BB.CCB.B..BC.C.....C.C..BC....B.B..B...CBB.BC.....C..CCB..CCBCCC.B.BB.CBBC..B.B.CCB........B.BC.BB.BB...C.B...BCB.B.B..CC..C.B.C.C..BBC.B........C....B....CB....BB......CBCB..BB
B.CC.B..CBC..B...CCC.....BB..CBCC.C...BB.C..B.BBB.BC.C...BB.BB..B.BC.CB.BC.BC.......

output:

B..................................................................................................................................................................................................................
C..........................................................................................

result:

ok 66 lines

Test #56:

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

input:

404 268
.....C...B..........CB....B....................B.....C.............B.B..........................B............C..B..........C.....CC.....B..........BC...C..........C.C....C...............................C.........B...................C......B.....B...C..................
..........B...............

output:

............................................................................................................................................................................................................................................................................
C.................................

result:

ok 404 lines

Test #57:

score: 0
Accepted
time: 3ms
memory: 7648kb

input:

384 57
....C.....BC..BC..B....B...B.......BB.........C.....BC.B.
CCCB.CCBBCBCBBCBC.CBCC.C.B.CBCC..B.CBCB.BBCB..CBB.BB.CCBC
BBBBB.CCBBCBCBBBCBBBCCCCCCCCBBCBCCCBBBBBCBBCBCBCCCBCBCCBC
..CC.....C..B.........B..B....C..BB.CC.CB.CCCCCB......C..
..CC.B.BCC.C.CBB...C..CB..BB.CBCCB...B.B.C.CB...B....BC.C
CBC...

output:

BBCCBCBCCCCCCCBCBCCBBBBCCBBBBBBCBCBCBBCCBCCBCCBBBCBBCBCCB
BBCBBBCBBCCBBBCBCBCCCCCCCBBBCBBBBBBCCCCBCBCBCCBCCCCCBCCBB
.BCCCCCCCCCBCBCCCCCCBCCBCBBCCBCCCCCCBBBCBCBCCBBBCCBCBBCCC
.CBBBBCCBBCCCBBBBCBCCCBBBCBBCBCCCBBCCCCBCBCBCCCBCBBBBBBBC
.BCBCCBBCCCCBCBBBBCCCCBBBBBCBCCBBBCBBCCCBBBCCBCCBCBCCBBCC
.CCBBBCCBB...

result:

ok 384 lines

Test #58:

score: 0
Accepted
time: 6ms
memory: 6116kb

input:

36 316
......BB..CB.BB.BCB..B..C.CBCB..........B....CBC..B.BCB..B.B.B....C.BC..B..CCB..CC.C.C.....BB...BC.CCCB....CBC.......C..........CCCC...C..C...C.C..C....C.B..C.BCB..BBC....B....B....C.CB.BC..BC.B.....BB...B..BB...C.BBB...CCCC...B.B..C....CCCC.C....BC.C....C.....C.CB.B..C.C..C..B....BCC..CCC..B...

output:

CCCCCBBBBCCCCCBCBCBBBCCBBCBCCBCCCBCCCBBBBBBCBCBCBCBBCBBBBBCBCCBCBBCCCCBCCCCCCBBBCBCBBCBCBCBBBCBCCCBCBBBCBBBCCBBCCBCBCBBCBBCCBBCCBCCCCCBCBBCCBBCBC..............................................................................................................................................................

result:

ok 36 lines

Test #59:

score: 0
Accepted
time: 6ms
memory: 8248kb

input:

173 369
................B...............B......B................BC.........C............C.............B............B.....B....B............C..............C....C...............................................C.........B.....B...........C...C...............B.........C.....C..C..............C..B..........

output:

BCBCBCBBBBCCCCBBBCBBCBCBCBBCCBCBBBBCCCCBCCCCBBBCBCB............................................................................................................................................................................................................................................................

result:

ok 173 lines

Test #60:

score: 0
Accepted
time: 13ms
memory: 7556kb

input:

287 386
BBBCCBBBCBCB.CBBCB..BCCC.B.CBBBBCBCC..BCBCBBC.CCBBCBBBCCBBBCBCBCCCBCCCBCBCB..CBCBCCCC.BBCBC.BCCBCCCBB.BBBBBBBCCBBBBCB.BCCCBBBCCCCCBBCCCCBCB.CCC.B.BCBBBCBCCCCBCCCBBBBBCBCB.BBCCBCBCCBBBCBCCBB.BCB.BBBCBBC.BCC.CCBCCCBBBCBBCCCBCBBCC.CCBB.CCC.BC.CCBBBCCCCBBBC.BB.CCBBB.CBBCCBBBBB.C.CBBBBBCBCBBBBCBB...

output:

...............................................................................................................................................................................................................................................................................................................

result:

ok 287 lines

Test #61:

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

input:

79 352
CC...B.C.....CC.CC.C..CC.C..C..CCC.B.C.B...BC.B......B.BBBBBC..B.....B.BBC.C.CC.CC..B..CCBC.BBBBCB..C..B.C..B..CC.BBBC..C..CCC...B...B..BC.BB.CCC...CC....B...BCBB.B..B..BCC.CC.BC..BC.CC.CBB.CCB..BBC.CB.CCCC..C....C.......B..BC.CBBC.B....B...C.C.B.C....B.BCC.CB..BB.CCC.B.CC..C.BCC.C......C.BC....

output:

CCBCCCCCCCCCCCCCBCBBCBBBBBBBCBBBBCCCCCCBCCBCBBBBCBCBCBCCBBBCCCCCBBBCBBCCCCCBBCBBBBBCCCCBCBCCCCBBCCBBBCCBCCCCCCBBCCBBCBBCCBCBBCCCBBBCCCBCCCBCCCCBCCCCBBCCBBBBCBBBCBBBBBBCBCCBCCBCBC.............................................................................................................................

result:

ok 79 lines

Test #62:

score: 0
Accepted
time: 95ms
memory: 9116kb

input:

424 488
BCCBCCCBC.BBBCCBCCCBCCCCBBBBCCBCBCCBCC.BBCCBB.CCCCBBCBBCCBCCBCBBBCCBCBCCBBCCBCCCCCCBBC.CCBCCBBBBBBCBCBBCBCBBBBBCBBCCCBCCBC.CBCCBC.BBBCBBBCBBCCCBCCBBBCCCBCCCBBBBC.BCCBBBCCCCBCBCCBBCCBCCBCCCCCBCBCBBBC.CBCBBBCCCCBB.CCCBBCBBBBCCCBCCBBCCBBBBBCCCCCCBBCCCCBB.CBCBBBCCCBBCBBCBBCCBC.BBBBCCBCCCBCCCBBBB...

output:

BBBCCCBCCBBCBCCCBCCBCBBBBCCCBCCCCBCBCCBCBCBCCCBCCCCBCCCBBCCCBCCCBCBCCBCCBCCCBCBBBBCCBCCCCBCCCBCCCBCCBCCCCBCBCCBBCBCCCBBCBCBCCBBCCCCBBBBCBCCBCBCBCCBCBBCBBBBCCCBCCBBCCBCCCBBBCBCBCBBCBCBCBBBCCCCBBBCCBCCCCCCBCCCBBCCCBBBCBBCCBBCCCBBBCCCBCCCBCBCCCBBCBBCBCCBCBCBCCCBBBCCBBBBBCBCBBCCBCCBCCBCBCBBBCCBBBBBCBBCB...

result:

ok 424 lines

Subtask #8:

score: 1
Accepted

Test #63:

score: 1
Accepted
time: 119ms
memory: 10908kb

input:

500 500
CC.CC...B..BCCB..C..C..CBBB..C..C..CCB.BC.CB.CCCCC..C......BC....BB.B.BB.....C...B..BBC...C....C.BB...BCBB.BCB.CC...B.CC....B.CC.B..BC.CB...C...BC.BBB...B.B.B..B.CB.CBBC..B.....CB.CB..BB.B.CCB.B.B..CC.B..CC.C.BB.BC..B.CBC.BB.....C......B.......C..C..BCB.BB.C.B....B..CB...B.CB...B.BCC.B.BB......

output:

CCCBBBBCCBCBBCBBCBBCCBCBCBBBBCBCBCCBBBBBCBCBCBCBCBBBBCBCCBCCCBBBCBCBBBCBBCCCBBCBCBBBBCCCCCCBCCCCCBBBBCCCBBCCCBBBCCBCCCBBBBCBCBCBCBBCCBBBBBBCCCBBBBCBCBBCBBBCBCCBBBBBCBBBCCBCCCBBCBCBCBCBBBBCBBBBCCBBCCBCCCBBBCCBCBCBCBCCBCCCBBBCCCBCBBCBBBBCBCCBCCCCCBCBBCCCCBBBBBBBBBCBBCCBBBBBBBCCBBCCBBCCBBCCCBCBBBBCBCBB...

result:

ok 500 lines

Test #64:

score: 0
Accepted
time: 8ms
memory: 6284kb

input:

68 342
CBC...B.C.CBBCCC.C.BBBCCB.BB.C...BCC...BCC...B..B.C...C.BCB.BB...C..B.B.C.B.BC...CC...B.BCBB...BBB.C.CBB......B..BC.B...BC..B..B.B.BB.BCBB.B..BCBCC..B....CC.BBC...BB...BC..BBBCBC...BC..C..BBC.C.C.CCB.B...B.CBBC.BB.CCCCC.C..C...C..B.CBB.B..C..BBBCCCB...BCC.BBBCC..CBB..B..B...C.BB...BB.B..CBB.....

output:

BBBCBBBCCCBCBBBCBBBCBBCCCCCCBCBBCBCBBCBBCBCCCBBCBBCCBBCBCBCCBCBBBBBCCBBCBCCCBBBBBBCCBCBCCBCBCBBBBCBCBCBBBCCCBCBBCBBBCCCCCCCBCCCCCCBCBBCCBBBBBCBBCBBBCCBBCBCBCCCCCBBBBBBCCCBBCCCCBBBBBBCBCCBBBBBBCBBCCBBCCBBBCCBBBBBCBBBBCBBCBBCBBCCCCCBCCCCBCBCCBBBBCCBBCCCCCCBBCBBCCBCBBCBCBCCCBBBBCCCCBCCCBBCCBCCBBCBCCBBB...

result:

ok 68 lines

Test #65:

score: 0
Accepted
time: 26ms
memory: 7188kb

input:

306 316
.C.B.........C....C...B.BC.BB....C....C..C.........B....CC..............B..C....C.....C.B..C.C.C.......C.......BC....B..................BC.....B........C..........CB.B.B.................C..B......................C..............BBB.C...B..........B...............................C....B.CC........

output:

...............................................................................................................................................................................................................................................................................................................

result:

ok 306 lines

Test #66:

score: 0
Accepted
time: 15ms
memory: 8656kb

input:

157 285
.BB..C...B.CBC.CC.B..CB......CC..B.CCB....BB.C..B.CB..CCCC..C.BCB.C..CC...C.C.BC....CB...BB...B.BBB.B.B.BCBCB...C.BC.CCB..B....B.BC.B....B.CCB..B.......BB.BCC.C.C.C...B...B.C.....CBB..BCBB.BC.B..C...B.B....BC..CCBBB.C..B.C..C.C.C.BCC...BBBC.B...C...C.C.BC.B.....CB.C..CB..B.C........CB
..C..C...

output:

.............................................................................................................................................................................................................................................................................................
.................

result:

ok 157 lines

Test #67:

score: 0
Accepted
time: 13ms
memory: 7044kb

input:

227 409
....CB................C.........B..........BCC..C..C......B...B........C...B...C.........C.....C..B.....B........................B.....B....B..............................................B....C.......B....C...........................C.....B...........C.........B......B.B.............C.C........

output:

...............................................................................................................................................................................................................................................................................................................

result:

ok 227 lines

Test #68:

score: 0
Accepted
time: 6ms
memory: 6068kb

input:

25 418
.................................................................C....................B......B................................B.......C...............C................C..............................................................C............C....................................................

output:

...............................................................................................................................................................................................................................................................................................................

result:

ok 25 lines

Test #69:

score: 0
Accepted
time: 18ms
memory: 8872kb

input:

297 215
.....B.B..C.B.CBBB.C.BBB....C.BC....B.C.B.B...CC....C.B..BB..B....B..C.C....CCC.....CB..C.B.BB..BBCCB.B.C..C...CB.B.C...BC..BC.CCC..........CCBB.CB.B.CBC.....BC..B.BBCBCCC..BBBCB..BBCB.CC.BCC..C..C.C.B.B.CB.BB.CC.CB
.CB.CCBC....C.C.BC....BB.C.BC....B.BC..CBB.C.....CCBB.CB....B...C.CC...BB.B....

output:

BCBBCCBBCCCCCBBBCBBCBBBBBCBCBBBBCBCBBCBCBBBBCBBBCCBCCCBCBCBBBCCBBCBCBCCBCCBBCCCCCCBBBBCBCBBCCBCCCCCBBCCCCCBCBBBCBCCBCBBCCCCBBCBCCCBCBCBBCCCCBBCCBBBBBBCCCBCCBCBBCBCCCCCBBBCCBCBCBBCBBBCCBCCBCCBCCCCCBCBBCBBCCCBCBCBCBCC
BCCBBBBBBBCCBCBCBBBCBBCBCBCBCCBCCBCBCCBCCBCCBBCBBCCBBBCCBCBBCBCCCBBCCBBBBBCCCBBCBCCC...

result:

ok 297 lines

Test #70:

score: 0
Accepted
time: 27ms
memory: 8132kb

input:

270 275
.....C..BB.CB..........C.BC..B...........B...BC.........BC.B...B......BB............C.....B..B......B..CB.B......C.........C.BB..B..C..C..........B.......C.......C....C.....CC............C.....CB.....CC.......B.B...........CC.B........C.......C...C.....B............B......B.
.........B..B.CC...

output:

..................................................................................................................................................................................................................................................................................C
...........................

result:

ok 270 lines

Subtask #9:

score: 1
Accepted

Test #71:

score: 1
Accepted
time: 134ms
memory: 10320kb

input:

500 500
...................................C................C........C......B........C...........B..BC..................................................................C.....C.............C..............................................B...........B.........B.........B...B..C............B...............

output:

...............................................................................................................................................................................................................................................................................................................

result:

ok 500 lines

Test #72:

score: 0
Accepted
time: 23ms
memory: 7520kb

input:

499 103
BCBBC....B..C.BCCCC.B.BBC...CC.B.CCCCCCB....B.CBCC..C.BBC.BB.CBC..CC..C.BB.B..B.BBC.B.B....C.BB.C.B.B.C
..CBB.......C.CBCCB.CC.CC..CCB.B..BCCC.B...CB..BB...B.CCBBC..BBCCBBCB.C..CCCB.CCCCC.B...C..B.C..C.....C
CC.B....BB.BB.CCCCB..BBBCB.BBB.C...BB..BC..BC..BCCB...CBC..C..C.BBB...BCBCBC.BBC.BB....

output:

.......................................................................................................
.......................................................................................................
C..............................................................................................

result:

ok 499 lines

Test #73:

score: 0
Accepted
time: 11ms
memory: 7216kb

input:

244 216
BCB.C..B..B.BBC.......B.CC..B.BC..B...CC.BC.C.CB.C.B.CCC......CCC..B....B.....B.B..C..B..C..C.C..CCCC..C.C..C....B.C.BBC.C.B..C..C...C.CBB..CB...C...BCB.B...C..CBCB...B.CC.BB..CCB..BCC...B.B.......BBBC..CB........BCB
C.B.........CBC..C..........C..CBC....B..CB.B..C.C.B.BBC..B.B.B.B..B.CBCC.B...

output:

BCBB....................................................................................................................................................................................................................
BBCC..................................................................................

result:

ok 244 lines

Test #74:

score: 0
Accepted
time: 12ms
memory: 7384kb

input:

281 97
BC...........C...B.B.B..BBBCB.BC.CBCC.BBB.CBBB.B.B.B.CC.C.B.B.BCB.B.C.B..C.B...BC.B..C...CB.B.CBC
.C...C.C.CBB..C..B...B..CCCCC......CBC.CB.BBCBCC.C..B...CC.CB...B.B.C.B....C..B..CCB..C...C..B.CB
..B...B..CB.BCB....BCC...C.BB....BCBCB.B..CB.B.BCB.BBB..C...C..BB.BC..C....CC..CC.C....CBB.CC.BCC...

output:

.................................................................................................
.................................................................................................
.................................................................................................
.........

result:

ok 281 lines

Test #75:

score: 0
Accepted
time: 10ms
memory: 6140kb

input:

32 498
CC...CBBCB.CBC.BB......BBCCBCBCBCB..CB....CBBCC.B.B..CCB.C..BCCB..B.CC.B..CC.C...BCCBB.B..BCC....BCCC...BB.B..C.BCBB.CC.BBC.B.BBCCBBC......B.CB..C.CBC..BCCB..C.BB.BBB..B..CCBCCBB....BB....B.BC..CCBB.B.CCBC..BBBC.CC.BB.BCC..BCB..CBB..C.C.C.CC.B....CC.BB..BB.....C.B..C.C.CC.BCBB.BB..C..C..CC.BC...

output:

.............................................................................................................................................................................CBBCCBBCCCBBCCBBBCCCCBBCBBBCBBBCCCBBCBCBBBBBBBCCCBBBCCCBBCBBBBBCCCBCCBBCCCBBCCBCBBCCCCBBBBCBCCBBCBBBCBBBCCBBBCCCCCCBCCCBCCCBCCB...

result:

ok 32 lines

Test #76:

score: 0
Accepted
time: 18ms
memory: 6868kb

input:

303 415
.............B.....C.B.B...B...CBB.............C............B...........BC.B................C....CB.........C.C....B.....C.B..B.........C...BB...........B....B.C....BB.............BB....C...........BCC.B...B.C...B..B...CB....C....CC...CB......C..............B......B....B..B..........CB.........

output:

...............................................................................................................................................................................................................................................................................................................

result:

ok 303 lines

Test #77:

score: 0
Accepted
time: 23ms
memory: 7708kb

input:

302 277
CC..B.CC.BBB.CC..C.BBCB..CCBBBC.CBC..BB..C.CB..CB.CCB.B....CCCCB.BCBCC..B.....B.C.BC..C.CC..B.C..BCBCB....BB..B...B.C....C..B..CB..CBC.C.B...BCBC..B..B.C...BB.CC..BCB.C...C.C...C.CB.C..B.CB..B.B...CC.BCB...BC...C....BBBB.B.CBBCCC..B.CCCB....C.CC.....CB.C.B...CC..BCCB.......B..
C.BCCB..C.CBC....

output:

.....................................................................................................................................................................................................................................................................................
.........................

result:

ok 302 lines

Test #78:

score: 0
Accepted
time: 3ms
memory: 5996kb

input:

94 188
CBC.CCC...BC..C.CB...BCCB.CBB..BB.C..C...C...B.BB.BCC.C.BC.CBB.C..CBC..C......CC.C..B...C.B.CCCBBCC.C..CCBBBB...CB.CB..B.BB.....CB.C...C....BB...BBC.CB..B....CC.B.BBC....CCC.C......CCC.C.C
....C.B.B.CBC.B.BB.B....CBC......C...C.CB..BBC.BB....B.CC.BCB.B.CC.C.CCCCC.C.C.BBCB....BCBB..CB.B..C.......

output:

..............................................................................................CBCCCCBCCCBBCCBCBBBBCCCBBBBCCCBCCBBCCBCCCCCBCBCCCBBCCCCCBBBBCBCBBBBCBCCBBBBCCBBCCBBBCCCCCCCCCC
...........................................................................................CBBCBCBBBBCBCCCCBBBC...

result:

ok 94 lines

Test #79:

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

input:

446 359
.C..CBC..CCBBBC.BC.C....B.B..C...BBB....B.BC..B..C.B..B..B.CB.CC..B..B...C.BB.C...BB...CC..BCB....B......CB.CBCBB...CB....B.CCCB.CB.CBC..B..BB.C....CCCCBC.B...B....CCC..C.B....B.B.CCC.BBCCC..C..CBB.C.BB......BC..BCBBC..BB..BB....C....CB..BC.C.C.BB.CCC.BB.BB.CC..BCCBCCB.B.CCBBB.BB..C....BC.BC...

output:

...............................................................................................................................................................................................................................................................................................................

result:

ok 446 lines

Subtask #10:

score: 1
Accepted

Test #80:

score: 1
Accepted
time: 129ms
memory: 10944kb

input:

500 500
.BBB.BCB.CCCBCBCCB.CB.CBBBCCCCBBBCBBCBCC.B.BCBCBBB.BBBBCCBBB.BBBBCCC.CCBBBCBCCCBBBCBCBBBCBBC.C.CBBBBBBC.BCCBBBBCBBCB.BCBB.CC.BCBB.CBB.BBBCCBCBCCBBC.CCCCBB.BBCBBBCBBBBCBBCBC.BBBBCBBBCCCC.CBBCCCB.C.C.CBBC.CCBBCCCCCCBC.BCCCBCCBCB.BBCBCCB.BCCBBC.BB.BCCCCCCCCCCCBBCC.C.CCCCBBBCCCB.BBBCBB..B.B.CBB....

output:

...............................................................................................................................................................................................................................................................................................................

result:

ok 500 lines

Test #81:

score: 0
Accepted
time: 10ms
memory: 6520kb

input:

114 336
.B.BC.BC.B.C.CBCC.C.BCC..BCB....C.CCBBBBBC.CCC.B.CBBB.B.BC.BBB.B.....C.....C.C..B..BCB..C.CC..C...BCC...BC..CB..BCB..C.BC.....CBCCC.C..CCBBCCB.C.B.C..CC..B..C.....B.C.C.CB......BB.C..C..CCBCC.B.BCCC.CCCBB.C...BCCCB...C...C...B.CBC.CBC.CBC...C..BBB.C...CC..BBB.CCBCB..CC.B.B..BCB.C.BBC.BBB..C....

output:

B..............................................................................................................................................................................................................................................................................................................

result:

ok 114 lines

Test #82:

score: 0
Accepted
time: 3ms
memory: 8312kb

input:

122 22
BBBCBBCBCCBBCCBCCBCBBB
BCC.C.C.B.....C..C....
....................B.
C...BB..C.B...B.B..C..
CBCBCCBCBBBCBBCCBBCCBB
..C.C.B....B..C..B.C.B
.........C...B....C.C.
BBBBCBBB.BBBB.CCCCBBCC
CCCB...CB.CBBC..CCCBCB
.BBC.CCBCBCCCCCBCCBBCB
...BC...B..........CB.
......................
BCBBBCCBCBBBC.CB....

output:

BBCCCCCBCBBCBBBCCBBCBB
CBBCCBBCCBCCCBBCBBBBCC
BCCCBBCCBBBCCBCBBCCCBB
BBCBCCBBCCBBBCBBBBCCBC
BBBBCCBCCCCBBCCCCBCBCB
BCBCBBBBCCBBCBBCBBBCBB
BCBBCCBBBBBCBCBCBBCBBC
CCCCBCCBBBBCBCBCBCCBCC
.CBCBCCCBCCBCCBCBCBBBC
.BCCBCCCBBBCBCCCCCCBBB
..CBCBBBBCBCCCCBCCBBBB
..BBBCBBBCCBCCCBBBBCCC
..BCCCCBCCCBCCCCBBBCCB
....

result:

ok 122 lines

Test #83:

score: 0
Accepted
time: 4ms
memory: 6292kb

input:

76 132
......C..........B.CCC....B.C..BB....CC......B.C..BBBCB..C......C..C.CC....C......C..C....CC..C.BC...CC......C...B..B.CC....B.B.C...
.BC...C.......C.B..BCC.BC.C.BC..BCB....CBCC....CBC.B...C..B...B........C.B..C.B..C.C..BC.......CBB.BC.CC...B.B.BBB.CB.CCB.BC.CC.C..B
....CC..C....B.C.........B....

output:

BCCBBCBBBBBBBCCBBCBCCCBCBBBBCCBBBBBBBCBBBBCCCBBBBBBBCBBCCBCBCCCBBBBBBBBCCBBCBBCBBBBBCCBBBBCBBBCCCCCBCBBBBCBCCCCCBCCBBBCCCCBCBCBCBBBB
.BCBCCBCBBBCBCCCBCCBCCCCBCBCBCBBBBCCBBCCCCBCCBBBBBCCCCCBBCCCBBBCCCCBCCBBCBCCBCBBBBBCBCBCCCBCCCBCBBCBBCCBBBCBCBCBCCBBBCCBBBBCBCBCBCCB
.CBBCCBCBCCBBCCCCCBCBBCBCBCCCBCCCB...

result:

ok 76 lines

Test #84:

score: 0
Accepted
time: 3ms
memory: 6892kb

input:

239 12
.BCBCCBBCBBB
CC..CBCCBBB.
BCCCBBC.BBBC
BBBBBC.CBBB.
C.CCC.C.BCBC
.BBBCCC.CB.B
BC.CBC..CBBB
..CCCCCCCB.C
CCBBBCCC.C..
.C.C.BC..BBC
CCC.CCCCBCB.
...CCCCCBB.C
.BC.BBBBBCCB
CCBBCCC.CCBC
BBBBB.BBBB.B
CCC.CBCC.CBB
CCBCC.C.BC..
.C..B.BCCCC.
BC.B.CCCCCBC
BCCCBC.CCCBB
CCCCCBBC..BB
CBCC.CBCC.BC
BCBCCCB...

output:

............
............
............
............
............
............
............
............
............
............
............
............
............
............
............
............
............
............
............
............
............
............
............
....

result:

ok 239 lines

Test #85:

score: 0
Accepted
time: 8ms
memory: 9004kb

input:

263 73
CBBC...CB...BCC.CCC.B..BCB.C..CC.BC..C.C.C..CCCC.B...BCC.CBC.BCC.CBCBCCB.
B.CCBB.CCBCBBCBB..C..BCB.CBB..BC...C.BCC...B.BC.C.....B.B..BBBBC.B.CBB..C
B.B.C.BCB.....B.CCBBBCCC.C..CB.B.C.CC..C..BB..CCB.C.BBBCBC.BB..BBCB...CBB
.BCCBCCB..BB.CC..C..CBBB.BBC.C.BCBBCCC.B..BCC.BCB..CB.C..BBB..B.B.CBBBB...

output:

.........................................................................
.........................................................................
.........................................................................
.........................................................................
.......

result:

ok 263 lines

Test #86:

score: 0
Accepted
time: 42ms
memory: 7304kb

input:

228 400
BCBBCB.CB..BB..C..B.BC.C....C.C.B...C.C......B...CB..C.B..B.C....B..B.....C....B.BC.B.......C.BC....CCCCBBC..C..BBCBC....C.C.BBC...B..C.B.BB.............C..C.B....CBBB.B..C.BBBCB.B........B..B....CB.BCB.B.C.CCC..CC..BCCBC.BCC..B.....BC..B....B.......C.....B.C.B.....BC..B...B.C...C..B....BB.C...

output:

...............................................................................................................................................................................................................................................................................BCCBBBCCBCCBBBBCCBBBBBCBCBBCC...

result:

ok 228 lines

Test #87:

score: 0
Accepted
time: 6ms
memory: 7076kb

input:

445 22
....C..CCBBCBCBB.B..C.
....C..CB.B...B.CBCCC.
..CBBBB..CBBB.C.BCC.CB
CB....CCCB.B...CC..BC.
...........C..BB.C.CC.
B...CC..C..BCC.BCCC...
B.C...B...C........BC.
.C.BB.C..BCCB.....CC..
.B.CB...C..BB..CBCCBCB
..B.B.B.B..B..BBB..B..
BBB.B..C.C.C.CCBB.B.BC
BB.C...B..C.C..B..BB..
C.B...CB.C.B.C.C....

output:

CCCBBCBCBBBC..........
CCBBBCBCCC............
CBBBBCBBBCBCCCB.......
CBCCCBBCCBC...........
CBBCCC................
BCCCBCCBCCC...........
BCBCBC................
CBBCBCCBCC............
BCBCBBCBCCBCB.........
BBBBBBBBB.............
BBBBCCCCCBBBBC........
BBCBCCBBB.............
CBCBCBCCB.............
B...

result:

ok 445 lines

Test #88:

score: 0
Accepted
time: 74ms
memory: 8712kb

input:

456 335
C.BC.C..CBC.BC...BC...B....CC...CB...C..CC.BCCBCCC.B...C..C..C.B....C.B.BB.B.B..C.B.BB.C...BBCB..CB...BB..BC.C..B.CB.C.CC.BBCCB.B..B...B..BCBBB.B.B.C.BC...CB.BB.B.C......BBBBB.C..B...C.BCC.C.BC.BC.C..B...C.....BBB.C.BCC.B...B.CBCBB.CCB.C...BCC.BC.C.C.BB.......BC.BB..C.CBCBCC.CBCCCCC.....BCC....

output:

.BCCCBBBBCBBCCBBBBCCBCCBBCCBCBBBCCBCCBBBBCBCCCBBCCCCCCCCCBCCCBCCBBBCBBBBCCCCBCBCCCBBBBBBCBBBCCBBBCCBCCBCCBCBCCBCCCBBBCCCBCBCBBBCCCCBBBBBCCCCCCCCCBBBBBBBBCBBBCCCCBBBBCBCCCCBCCCBCBBCBBCCCCBBCCBBBCCCCBBBBCBBCBCCCCCBCBBCBBCBCCCCBCCBCCBCBCCBBCCCCBCCBCBBBBCCBCBCBCCBBBCCBBCBBCBCCCCCBCBBBCCBCBCBBCBBCCBCBCCB...

result:

ok 456 lines

Extra Test:

score: 0
Extra Test Passed