QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#254534#8981. Kangaroo Puzzleucup-team1099#AC ✓1ms3744kbC++201.8kb2023-11-18 13:15:522024-11-05 18:07:57

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3652kb

input:

4 4
1111
1001
1001
1110

output:

UULLLDDDRRLLUUURRRDDLLUUURRRDDUULLLDDDRRL

result:

ok AC

Test #2:

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

input:

2 15
111111111111111
101010101010101

output:

URRRRRRRRRRRRRRDULLDULLDULLDULLDULLDULLDULLDURRRRRRRRRRRRDULLDULLDULLDULLDULLDULLLLDURRDURRRRRRRRRRDULLDULLDULLDULLDULLLLLLDURRDURRDURRRRRRRRDULLDULLDULLDULLLLLLLLDURRDURRDURRDURRRRRRDULLDULLDULLLLLLLLLLDURRDURRDURRDURRDURRRRDULLDULLLLLLLLLLLLDURRDURRDURRDURRDURRDURRDULLLLLLLLLLLLLLDURRDURRDURRDURRD...

result:

ok AC

Test #3:

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

input:

1 2
11

output:

RLLRL

result:

ok AC

Test #4:

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

input:

20 20
00000000000000000000
00000000000000000000
00000000000000000000
00000000000000010000
00000000000000010100
00000000000000111110
11001100000001101001
01110100111001000111
10011111101111001101
11110100110101001001
01000000001101011101
00000000000011010000
01000000000110010000
11100000001010110000
...

output:

DDRRRLUDLDULLDLDDLLLULLDLLLLLDLLLUDRDURRUULLULRDRRDRRDUUULRDDRRRDRLUURRDRDDLRUURRDDDLDLRDDRLDLLDLLLRUDRDDDRRLLLLLULLULULULLDDDRRLDULUUURUURLLRUDDDRDRDRDRRUDDRRRUUURUULRUDDRRDRRURRRDRRLLULLUULRUUURRLUURURRDDDUUUUDLLDLDDLDDDDDLDLLUUUUURUUUUURURUUDRLLLLDLDDLLLULLDLLLLLDLLLUDRDURRUULLULRDRRDRRDUUULRDDRR...

result:

ok AC

Test #5:

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

input:

20 20
10101010000000111100
11111110000000100111
00101000000000000101
11101100000000001011
01000101100000001101
01001110111010111011
00111011001011101010
00101001111001001111
11001011000111011010
01010110000000110100
11110010000101011100
10011111101101110011
10101000100111000110
11100111111100111011
...

output:

DRRRRRRUDLLDDRDDRDRDRRRUULLULRDRRDDLLLDLDLRDDRRDDRRRDRDRDRRRRRURLUURLULRURLDDDDDLLUUULLDURRDDDLDULLDLDLLLLDLRURRDUUUULRDDDRRURUULULUURRURRURRUDLLULRURURRRLDUUURUULRUULLDUULLLDURRRDRRDDDDLDDLLUULLDLLUDRDDLLRRUURURRURLUDDDDDLDDDLLUDDLLULRUDDDLLLLLLDLRDRRDRLDUULLUURRRDUUULLLLLULLLDDDRRUDLLDDRRRDDRRDRLD...

result:

ok AC

Test #6:

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

input:

20 20
11101111101011101010
10110000101100111111
11011111100101001010
10010010110111110111
01101001101101010101
11001111010101011001
01110101110010001111
11010100001110011001
01010111101011100111
10111100100100111101
11001011111101010100
10111010010011010011
10100110111110111110
11101011010101101000
...

output:

RRRRDDLLLLLDUULULLDDRLDUUURRDRDRRRDURRDRLDLDLLLUDRDDDRRRDDRRRUDLLDDRRRURUDLDLDDDRRLLLLRRDDRRDRRDRLUURRRRDDLRUULUURLULRDDDLDULLULRURLULULRURRRRURLDLLDULUUURRDUURRDUUULLLDLRUULUULLLLDLRDUUUULUDRDDRRDDUUUDRRDDRDRRRUUULLDURUURLLLLLULLRRDRRDUUDRRUDDDRDDDDDLLDLLLULLULLDURRUDDRRDRDDDLDDRDDDDLLULLDDRLLLLLLL...

result:

ok AC

Test #7:

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

input:

10 10
1010100000
1111110000
0001010000
0101000000
1111100000
1001000000
1110000000
1011000000
0001100000
0000110000

output:

DRRRRRDULUDLDDDRLLLLDDRRDRDRDRLULULULLDUUURUDRRDUUUULUDLLUDRRRDULUDLDDDRLLLLDDRRDRDRDRLULULULLDUUURUDRRDUUUULLLUDRRUDRDULLLLLUDRRUDRDDDRLLLLDDRRDRDRDRLULULULLDUUURUDRRDUUUURUULLLLLUDRRUDRDDDRLLLLDDRRDRDRDRLULULULLDUUURUDRRDUUUURUDRDDRRRLDUUUURRDULUDLLLLUDRRUDRDDDLLLDDRRDRDRDRLULULULLDUUURULLLLDDRRDR...

result:

ok AC

Test #8:

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

input:

12 12
000000011101
000011110111
000001010001
000011000011
000010000000
000010000000
000000000000
000000000000
000000000000
000000000000
000000000000
000000000000

output:

DLLULLDLLLRDDLDDUURUURRDUURRDRRDDLRUUURRRDUURRDRRDDLRUUUDLLULLDLLDDLDDUURUULULLLRDDLDDUURUURRURRDRRDDLRUUUDLLULLDDRUULLULLDLLLRDDLDDUURUURRDUURRDRRUDDDLUURUURRDUURRDRRDDLRUUUDLLULLDLLLRDDLDDL

result:

ok AC

Test #9:

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

input:

20 20
00000000000000000000
00000000000000000000
00000000000000000000
00000000000000000000
00000000100000000000
00000011110000000000
00000001010000000000
00000000000000000000
00000000000000000000
00000000000000000000
00000000000000000000
00000000000000000000
00000000000000000000
00000000000000000000
...

output:

DRDULLLRDURURRRDULUDLDULURRDULUDLLRDULLLRDURUDRDL

result:

ok AC

Test #10:

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

input:

20 20
00000000000111111111
00000000000010010100
10000000000001110111
10000000110010010100
11000011010011010001
01000010010101011111
01110111110111110000
11011101011100100011
01000000110000111110
11000000000000101010
01110100100001101101
11011111111000010111
10000010101001111010
11000011000111010010
...

output:

RRRRRRRRLLDDRRLLDUUULLDDLLRRDDDRRRRUDLLLLDLLLLDLLDLRUULLLLDLLULLDLRDDLRDRRDRRRRRRRDULLDUUDLLDDRLUULUDLLULLDLDDRLUURUUUUUUULUUDDRDDRRDRRURUURLDDRDURRUUULRDDDDRRUUDRRUULUDRDDRDDRRRRDUURLDLLDDRDRRUDLDDDRLLDLLLLLLRRRDDRRRRDRDULULLLLLRDDRRLLUUUURUUURLLLDLLRRURRUDDDDRRURUUULULUULLDDLRUUUURUUUUUULLLDULLLLL...

result:

ok AC

Test #11:

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

input:

2 1
1
1

output:

DUUDL

result:

ok AC

Test #12:

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

input:

20 20
11111111111111111111
10000000000000000000
11111111111111111111
00000000000000000001
11111111111111111111
10000000000000000000
11111111111111111111
00000000000000000001
11111111111111111111
10000000000000000000
11111111111111111111
00000000000000000001
11111111111111111111
10000000000000000000
...

output:

LLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDDRRURRDRRURRDRRURRDRRURRDRRRLUDLLULLDLLULLDLLULLDLLULLDLLUUURRRRRDURRRRDURRRRDURRRRDURRDUUULLLLLLLLLLLLLLLLLLLU...

result:

ok AC

Test #13:

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

input:

20 20
11111011111011111011
00101100101100101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
...

output:

RRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRDUUULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRRDDUUUULULULULULUURRDRDRRDDUUUULRDDLLULULLLLRRDDRDRDRDRDRDDLLULULULULULULULULLLLRRDDRDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRDDLLLULULULULULULULULULULULULULULULLDDRDRDRDRDRDRD...

result:

ok AC

Test #14:

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

input:

20 20
11101110111110111110
10011011001011001011
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
...

output:

LLDDRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRDUUULULULULULULULULULULULULULULULULRURRDRDRDRDRDRDRDRDRDRDRDRDRRDDUUUULULULULULULULULULUURRDRDRDRDRDRDRRDDUUUULULULUURRDRDULULLLLRRDDRDRDRDDLLULULULULULULLLLRRDDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULU...

result:

ok AC

Test #15:

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

input:

20 20
11111111111111111111
10000000000000000000
11111111111111111111
00000000000000000001
11111111111111111111
10000000000000000000
11111111111111111111
00000000000000000001
11111111111111111111
10000000000000000000
11111111111111111111
00000000000000000001
11111111111111111111
10000000000000000000
...

output:

LLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDULLDULLDULLDULLDULLDULLDULLDULLDULLDULUURRRRRRRRRRRRRRRRRRRUULLLLLLLLLLLLLLLLLLLUURRRRRRRRR...

result:

ok AC

Test #16:

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

input:

20 20
00111100111100111101
11101011101011100001
10100110100110100111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101101
10011011011011011001
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101101
10011011011011011001
...

output:

LLLDLLDURRDDLDLDDRRURURURURURRDDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDDRRURURURURURRDDLDLDDRRUDLLLLRRUURURUUUUDDLLDLDLDLDLDLLLLRRUURURURURURURURURUUUUDDLLDL...

result:

ok AC

Test #17:

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

input:

20 20
01000111000111000111
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
00110110110110110111
01011011011011011010
11101101101101101100
10110110110110110110
11011011011011011011
01101101101101101101
00110110110110110111
01011011011011011010
11101101101101101100
...

output:

DRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULULULULULRURRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULRURRDRDRDRDRDRRUULULULRURRDULLDDRDRDDLDULULULULULULLDDRDRDRDRDRDRDRDRDDLDULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDRDRDRDRDDLDULULULULULULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRD...

result:

ok AC

Test #18:

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

input:

20 20
10111110111110111101
11101001101001101001
10011011011011011001
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101101
10011011011011011001
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101101
...

output:

DRRURRRRLLDDLDLDLDLDDRRURURURURURURURRRRLLDDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURRRLDDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURRDDLDLDLDLDLDLDLDDRRURURURURRDDLDLDLRURURUUUUDDLLDLDLDLDLLLLRRUURURURURURURURUUUUDD...

result:

ok AC

Test #19:

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

input:

20 20
10111110111110111110
10001011001011001011
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
...

output:

DDRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRDRDRDRDRRDDUUUULULULULULULULULULUURRDRDRDRDRDRDRRDDUUUULULULUURRDRDULULLLLRRDDRDRDRDDLLULULULULULULLLLRRDDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULLLLRRDDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDDLDULULULULULULULULULULU...

result:

ok AC

Test #20:

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

input:

20 20
10011111011111011111
11100101100101100101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
11101101101101101101
...

output:

DRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRDDUUUULULULULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRDRDRDRRDDUUUULULULULULULULULUURRDRDRDRDRDRRDDUUUULULUURRDULLLLRRDDRDRDDLLULULULULULLLLRRDDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULLLLRRDDRDRDRDRDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULULULULULLDDRDRDRDR...

result:

ok AC

Test #21:

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

input:

20 20
11111011111011111011
00101100101100101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
...

output:

RRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRRDDUUUULULULULULUURRDRDRRDDUUUULRDDLLULULLLLRRDDRDRDRDRDRDDLLULULULULULULULULLLLRRDDRDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRDDLLLULULULULULULULULULULULULULULULLDDRDRDRDRDRDRDRD...

result:

ok AC

Test #22:

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

input:

20 20
11111111111111111111
10000000000000000000
11111111111111111111
00000000000000000001
11111111111111111111
10000000000000000000
11111111111111111111
00000000000000000001
11111111111111111111
10000000000000000000
11111111111111111111
00000000000000000001
11111111111111111111
10000000000000000000
...

output:

LLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDDRRURRDRRURRDRRURRDRRURRRDRRUDLLULLLDLLULLDLLULLDLLULLDLLUUURRRRRRRRRRRRRRRRRRDURUULLLLLLLLLLLLLLLLLLLUURRRRRRR...

result:

ok AC

Test #23:

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

input:

20 20
00011100011100011100
00010110010110010110
00011011011011011011
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
00110110110110110111
00011011011011011000
11101101101101101100
10110110110110110110
11011011011011011011
01101101101101101101
00110110110110110111
...

output:

ULULULLDDRDRDRDRDDLLULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULLDDRDRDRDRDRDRDRDDLLULULULULLDDRDRDULULUURRDRDRDRDRRUULULULULULULULUURRDRDRDRDRDRDRDRDRDRDRR...

result:

ok AC

Test #24:

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

input:

20 20
11111011111011111011
00101100101100101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
...

output:

RRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRDDUUUULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRRDDUUUULULULULULUURRDRDRRDDUUUULRDDLLULULLLLRRDDRDRDRDRDRDDLLULULULULULULULULLLLRRDDRDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRLDLLULULULULULULULULULULULULULULULLDDRDRDRDRDRD...

result:

ok AC

Test #25:

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

input:

20 20
01101111011111011111
11011010010010010010
10110110110110110110
11101101101101101101
10011011011011011001
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101101
10011011011011011001
00110110110110110111
11101101101101101101
10011011011011011011
...

output:

LDLDDRRURURURRRLDDLDLDLDLDLDLDDRRURURURURURURURUURRRRLDDLDLDLDLDLDLDLDLDLDLDLLDDDRRURURURURURURURURURURURURURUURRRRLDDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLLLDDRRRRURURURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURRDDLDLDLDLDLDDRRURURRDDLRUUUUDDLLDLDLLLLRRUURURURURURUUUUDDLLDLDLDLDLDL...

result:

ok AC

Test #26:

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

input:

20 20
10101010101010101010
10111111111111111111
11000000000000000001
10111111111111111111
10100000000000000000
10111111111111111111
11000000000000000001
10111111111111111111
10100000000000000000
10111111111111111111
11000000000000000001
10111111111111111111
10100000000000000000
10111111111111111111
...

output:

DDRLDDDDRLDDDDRLDDDDRLDDDDDRRRRRRRRRRRRRRRRRRRUULLLLLLLLLLLLLLLLLUURRRRRRRRRRRRRRRRRUULLLLLLLLLLLLLLLLLUURRRRRRRRRRRRRRRRRUULLLLLLLLLLLLLLLLLUURRRRRRRRRRRRRRRRRUULLLLLLLLLLLLLLLLLUURRRRRRRRRRRRRRRRRUULLLLLLLLLLLLLLLLLUDRRUDRRUDRRUDRRUDRRUDRRUDRRUDRRUDRDDLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRDDLLLLLLLL...

result:

ok AC

Test #27:

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

input:

20 20
11011111011111011111
10110100110100110101
11101101101101101101
10011011011011011010
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101101
10011011011011011001
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
...

output:

LDDRRURURRRRLLDDLDLDLDLDLDDRRURURURURURURURURRRRLLDDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURURRRRDDUULLDDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLRDRRURURURURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURRDDLDLDLDLDLDLDDRRURURURRDDDLLRRUUUUUDDLLDLDLDLLLLRRUURURURURURURUUUU...

result:

ok AC

Test #28:

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

input:

20 20
01101111101111101110
11011010011010011010
10110110110110110110
11101101101101101101
10011011011011011001
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101101
10011011011011011001
10110110110110110111
01101101101101101101
11011011011011011011
...

output:

LDLDDRRURURURRRRLLDDLDLDLDLDLDLDDRRURURURURURURURURURRRRLLDDLDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURRDDLDLDLDLDLDDRRURURRDDLRUUUUDDLLDLDLLLLRRUURURURURURUUUUDDLLDLDLDLDLDLDL...

result:

ok AC

Test #29:

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

input:

20 20
01111101111101110111
11010011010011010101
10110110110110110101
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101101
10011011011011011001
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101101
10011011011011011001
...

output:

LLLLDLDURURRDDLDLDLDDRRURURURURURURRRRLLDDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDDDRRRLUURURURURURURURURURURURURURURURUUURRDDDDLDLDLDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDDRRURURURURURRDDDLLDDRRLLLLRRUURRUUUUUDDLLDLDLDLDLDLLLLRRUURUR...

result:

ok AC

Test #30:

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

input:

20 20
11011111011111011111
10110100110100110100
11101101101101101101
10011011011011011001
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101101
10011011011011011001
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
...

output:

LDDRRURURRRRLLDDLDLDLDLDLDDRRURURURURURURURURRRRLLDDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURURRRRLLDDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURRDDLDLDLDLDLDLDDRRURURURRDDDLLRRUUUUUDDLLDLDLDLLLLRRUURURURURURURUUUUDDLLDL...

result:

ok AC

Test #31:

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

input:

20 20
11110001110001110001
01011001011011011001
01101101101101101111
00110110110110110100
00011011011011011000
11101101101101101100
10110110110110110110
11011011011011011011
01101101101101101101
00110110110110110111
00011011011011011010
11101101101101101100
10110110110110110110
11011011011011011011
...

output:

RRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRDUUULULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRDRRUULULULULULULULRURRDRDRRRUUDDLLDULULULLDDRDRDRDRDRDRDDLDULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULULULLDDRDRDRDRDRDR...

result:

ok AC

Test #32:

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

input:

20 20
11111110011110111110
00001011101011001011
11101100101101101100
10110110110110110111
11011011011011011010
01101101101101101111
10110110110110110101
10011011011011011011
11101101101101101100
10110110110110110111
11011011011011011010
01101101101101101111
10110110110110110010
10011011011011011011
...

output:

RRRRRRDRRDDRDRDRDRDRDRDRDRDRRRLDDRLUUUURLLULULULULULULULUURRDRDRDRDRDRRRDDLRUULUURLLULUURRDRLULLLLRRDDRDRDDLDULULULULULULLLRDDRDRDRDRDRDRDRDRDDLLULULULULULULULULUULLULLDDRDRDRDRDRDRDRDRDRDRDRDRDRDRRLDDLLULULULULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDRDRDRDRDDRRRRRUDLLLLLLLULULULULULULULULULULU...

result:

ok AC

Test #33:

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

input:

20 20
11011111011111011111
10110100110100110100
11101101101101101101
10011011011011011001
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101101
10011011011011011001
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
...

output:

LDDRRURURRRRLLDDLDLDLDLDLDDRRURURURURURURURURRRRLLDDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURURRRRLLDDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURRDDLDLDLDLDLDLDDRRURURURRDDLDLRURUUUUDDLLDLDLDLLLLRRUURURURURURURUUUUDDLLDL...

result:

ok AC

Test #34:

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

input:

20 20
10111110111110111110
10001011001011001011
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
...

output:

DDRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRDUUULULULULULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRDRDRDRDRRDDUUUULULULULULULULULULUURRDRDRDRDRDRDRRDDUUUULULULUURRDRDULULLLLRRDDRDRDRDDLLULULULULULULLLLRRDDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULLLLRRDDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULU...

result:

ok AC

Test #35:

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

input:

20 20
11011100011100011101
10110110110110110111
11101101101101101101
01011011011011011010
00110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101100
10011011011011011010
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
...

output:

LDDRRURURRDRLDLDLDLDLDLDDRRURURURURURURURURRDRLDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURURRDRRDUUDLLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLRDRRURURURURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDLRDRRURURURURURURURURURRDDLDLDLDLDLDLDLRDRRURURURRDDLDLRURUULUDLDLDLDLLUURURURURURURUULUDLDLDL...

result:

ok AC

Test #36:

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

input:

20 20
11111111111111111111
10101010010101010101
10000000000000000000
11111111111111111111
00000000000000000001
11111111111111111111
10000000000000000000
11111111111111111111
00000000000000000001
11111111111111111111
10000000000000000000
11111111111111111111
00000000000000000001
11111111111111111111
...

output:

URRRRRRRRRRRRRRRRRDULLDULLDULLDULLDULLDULLLDULLDULLLLDDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRDDLLLLLLLLLLLLLLLLLLLDDRRRRRRRRRRRRRRRRRRRLLLLLLLLLLLLLLLLLLLUURRRRRRRRRRRRRRRRRRRUULLLLLLLLLLLLLLL...

result:

ok AC

Test #37:

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

input:

20 20
10011111011111011111
11100101100101100101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
11101101101101101101
...

output:

DRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRDDUUUULULULULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRDRDRDRRDDUUUULULULULULULULULUURRDRDRDRDRDRRDDUUUULULUURRDULLLLRRDDRDRDDLLULULULULULLLLRRDDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULLLLRRDDRDRDRDRDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULULULULULLDDRDRDRDR...

result:

ok AC

Test #38:

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

input:

20 20
11000111110111110111
01001101001101001101
11011011011011011011
10110110110110110110
11101101101101101101
10011011011011011001
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101101
10011011011011011001
10110110110110110111
01101101101101101101
...

output:

RDDLDDRRURURURURRRRLLDDLDLDLDLDLDLDLDDRRURURURURURURURURURURRRRLLDDLDLDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLLLDURRRDRRURURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLRDRRURURURURURURURRDDLDLDLDLDDRRURURUDLDLDLLLLRRUURURURURUUUUDDLLDLDLDLDLDLD...

result:

ok AC

Test #39:

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

input:

20 20
10111110111110111011
11101001101001101010
10011011011011011010
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101100
10011011011011011010
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101100
...

output:

DRRURRRRLLDDLDLDLDLDDRRURURURURURURURRRRLLDDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDLDLRDRRURURURURURURURURURURRDDLDLDLDLDLDLDLDLRDRRURURURURRDDLDLRDRLUURUULUDLDLDLDLDLLUURURURURURURURUULUDLDLDL...

result:

ok AC

Test #40:

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

input:

20 20
11111011111011111011
00101100101100101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
...

output:

RRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRDDUUUULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRRDDUUUULULULULULUURRDRDRRDDUUUULRDDLLULULLLLRRDDRDRDRDRDRDDLLULULULULULULULULLLLRRDDRDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDDRLLLULULULULULULULULULULULULULULULLDDRDRDRDRDRD...

result:

ok AC

Test #41:

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

input:

20 20
11111101111101110111
10010011010011011001
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101101
10011011011011011001
10110110110110110111
01101101101101101101
11011011011011011001
10110110110110110111
11101101101101101100
10011011011011011010
...

output:

LLLLLDDUURRRDDLDLDLDDRRURURURURURURRRRLLDDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURRDRLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURRDDDLLDLDLDLDLDLDLDDRRURURURURURRDDLDLDDRRUDLLLLRRUURURUULUDLDLDLDLDLDLLLLRRUURURURURUR...

result:

ok AC

Test #42:

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

input:

20 20
00111110111110111110
01101001101001100011
11011011011011011110
10110110110110110001
01101101101101101111
11011011011011011001
10110110110110110111
11101101101101101100
10011011011011011001
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101101
...

output:

LLLLDLDLDURURURRDDLDLDLDLDDRRURURURURURURURRRRLLDDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURURRRRDRLDLLLDLDLDLDLDLDLDLDLDLDLDLDLDLDLLDDDRRURURURURURURURURURURURURURURURRRDDLLDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURRDDLDLDLDLDLDLDLDDRRURURURURRDDLDLDLRURURUUUUDDLLDLDLDLDLLLLRRUURURURURURUR...

result:

ok AC

Test #43:

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

input:

20 20
11111011111011111011
00101100101100101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
...

output:

RRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRDDUUUULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRRDDUUUULULULULULUURRDRDRRDDUUUULRDDLLULULLLLRRDDRDRDRDRDRDDLLULULULULULULULULLLLRRDDRDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDDRLLLULULULULULULULULULULULULULULULLDDRDRDRDRDRD...

result:

ok AC

Test #44:

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

input:

20 20
00001110001110001110
00001011001011001011
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
00110110110110110111
00011011011011011000
11101101101101101100
10110110110110110110
11011011011011011011
01101101101101101101
00110110110110110111
00011011011011011000
...

output:

ULULLDDRDRDRDDLLULULULULULULLDDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDDLLULULULULULLDDRDRDRDULULULUURRDRDRDRDRDRRUULULULULULULULULUURRDRDRDRDRDRDRDRDRD...

result:

ok AC

Test #45:

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

input:

20 20
11111101111101111101
10010110010110010111
01011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
...

output:

RRRRDRDRDRDRDRDRDRRDDUUUULULULULUURRDRRDDUUUDLLULLLLRRDDRDRDRDRDDLLULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULULLLLLDURRRDDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDRDRDRDDRRLLLLULULULULULULULULULULLDDRDRDRDRDRDRDRDDRRLLLLULULULULL...

result:

ok AC

Test #46:

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

input:

20 20
11100011100011101100
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011010
11101101101101101100
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011010
11101101101101101100
10110110110110110110
...

output:

RDRDRDDLLULULULULLDLRDRDRDRDRDRDRDRDDLLULULULULULULULULULULLDLRDRDRDRDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRLDLLULULULULULULLDDRDRDRDRDDRRLLLLULLDUUUDDRRDRRUULULULULUUUUDDRRDRDRDRDRDRDRRDRRRLUDLLUU...

result:

ok AC

Test #47:

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

input:

20 20
11111000111000111011
00101101101101101110
10110110110110110011
10011011011011011010
11101101101101101100
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011010
11101101101101101100
10110110110110110110
11011011011011011011
01101101101101101101
...

output:

RRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULULRURRDRDRDRDRDRDRDRDRRUULULULULULULRURRDRRDRLDUUURLDLLULLDDRDRDRDRDRDDLDULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRDDLLLULULULULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDRDRD...

result:

ok AC

Test #48:

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

input:

20 20
11101110111011101111
10111011101110111001
10010101010101010101
11101110111011101110
10111011101110111011
01010101010101010010
11101110111011101110
10111011101110111011
10010101010101010101
11101110111011101110
10111011101110111011
01010101010101010010
11101110111011101110
10111011101110111011
...

output:

URURRDRRURRDRRURRDRRURRRDDUULLLDLDULULLDLDULULLDLDULULLDLLULLDDDRRDRRURRDRRURRDRRURRDRRURRDRLDDLLDLLULLDLLULLDLLULLDLLULLDDDRRDRRURRDRRURRDRRURRDRRURRDRLDDLLDLLULLDLLULLDLLULLDLLULLDDDRRDRRURRDRRURRDRRURRDRRURRDRLDDLLDLLULLDLLULLDLLULLDLLULLDURUDRDRRURUDRDRRURUDRDRRURUDRDRRURRDRLUUUULUDLDLDULULUDLDL...

result:

ok AC

Test #49:

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

input:

20 20
11101110111011101110
10111011101110111011
10010101010101010101
11101110111011101110
10111011101110111011
01010101010101010010
11101110111011101110
10111011101110111011
10010101010101010101
11101110111011101110
10111011101110111011
01010101010101010010
11101110111011101110
10111011101110111011
...

output:

URURRDRRURRDRRURRDRRURRDRDULULLDLDULULLDLDULULLDLDULULLDLLULLDDDRRDRRURRDRRURRDRRURRDRRURRDRLDDLLDLLULLDLLULLDLLULLDLLULLDDDRRDRRURRDRRURRDRRURRDRRURRDRLDDLLDLLULLDLLULLDLLULLDLLULLDDDRRDRRURRDRRURRDRRURRDRRURRDRLDDLLDLLULLDLLULLDLLULLDLLULLDURUDRDRRURUDRDRRURUDRDRRURUDRDRRURRDRLUUUULUDLDLDULULUDLDL...

result:

ok AC

Test #50:

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

input:

20 20
11101111011011101111
10110101110010110010
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011010
11101101101101101101
10110110110110110111
11011011011011011001
01101101101101101101
10110110110110110111
11011011011011011001
01101101101101101101
10110110110110110110
...

output:

RRRDRRDRDRDRDRDRDRDRDRDRRDDUUUUULLULULULULULUURRDRDRDRDRRUULUURLLLRRDDRDDLDULULULULULLDDRDRDRDRDRDRRUDDDDLLULULULULULULULULUURLDLLDLRDRDRDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRLDDRRRRUDLLUDLLLLLULRURLULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRLDDRL...

result:

ok AC

Test #51:

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

input:

20 20
01000111011111011111
11101101100101100101
10110110110110110110
11011011011011011011
01101101101101101101
00110110110110110111
01011011011011011010
11101101101101101100
10110110110110110110
11011011011011011011
01101101101101101101
00110110110110110111
01011011011011011010
11101101101101101100
...

output:

DRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULULULULULULULULRURRDRDRDRDRDRDRDRDRDRDRDRRUULULULULULULULULUURRDRDRDRDRDRRUULULUURRDULLLLRRDDRDRDDLDULULULULULULLLLRRDDRDRDRDRDRDRDRDRDDLDULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDRDRDRDRDDLDULULULULULULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRD...

result:

ok AC

Test #52:

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

input:

20 20
11111011111011111011
00101100101100101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
00110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
...

output:

RRRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRDDUUUULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRRDDUUUULULULULULUURRDRDRRDDUUUULRDDLLULULLLLRRDDRDRDRDRDRDDLLULULULULULULULULLLLRRDDRDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDDRLLLULULULULULULULULULULULULULULULLDDRDRDRDRDRD...

result:

ok AC

Test #53:

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

input:

20 20
10111011111011111001
10101100101100101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
10011011011011011011
11101101101101101101
...

output:

DDDDRRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRRLUULULULULULULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRDRDRDRDRDRDRRDDUUUULULULULULULULULULULULUURRDRDRDRDRDRDRDRDRRDDUUUULULULULULUURRDRDRRDDUUUUDDLLULULLLLRRDDRDRDRDRDRDDLLULULULULULULULULLLLRRDDRDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULULULLDDRDRDRDRDRD...

result:

ok AC

Test #54:

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

input:

20 20
01111101111101111100
10010110010110010110
10011011011011011011
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
10011011011011011001
11101101101101101101
10110110110110110110
11011011011011011011
01101101101101101101
10110110110110110111
...

output:

RRRRDRDRDRDRDRDRDRDRDRDRDRDRDRRDDUUUULULULULULULULULULULUURRDRDRDRDRDRDRDRRDDUUUULULULULUURRDRDRDULULULLLLRRDDRDRDRDRDDLLULULULULULULULLLLRRDDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDRDDLLULULULULULULULULULULULULULULULULLDDRDRDRDRDRDRDRDRDRDRDRDRDRDDRRLLLLULU...

result:

ok AC

Test #55:

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

input:

20 20
01110001110001110000
11010011010011010000
10110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101100
00011011011011011000
00110110110110110111
01101101101101101101
11011011011011011011
10110110110110110110
11101101101101101100
00011011011011011000
...

output:

URURRDDLDLDLDDRRURURURURURURRDDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDLDLDLDDDRRUURURURURURURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDLDLDLDLDLDLDDRRURURURURURURURURURURURRDDLDLDLDLDLDLDLDLDDRRURURURURURRDDLDLDDRRUDLLUURURUULLDLDLDLDLDLLUURURURURURURURURUULLDLDLDLDLDLD...

result:

ok AC

Extra Test:

score: 0
Extra Test Passed