Submission ID Problem Status Score Time Memory Code / Answer files User Submit time
#19229 #59. 猜字母王 Hexguesser Wrong Answer 0 11482 ms 30736 K Python 3 / 779 B HKSCF2023-017 2023-07-15 17:26:50
for i in range(2):
    a=input(),strip()
    b=input(),strip()  
def deduce(guess, response):
    letters = set()
    for g,r in zip(guess, response):
        if r == 'o':
            letters.add(g)
            return letters
n, m = map(int, input().split())
guesses = []
responses = []
for _ in range(m):
    guess, response = input().split()
    guesses.append(guess)
    responses.append(response)
for _ in range(n):
    l, r = map(int, input().split())                                                                    
    deduced = set()
    for i in range(l-1, r):
        deduced |= deduce(guesses[i], responses[i])
        if len(deduced) == 6:
            print('-1') 
        else: 
            print(len(deduced))                             
Subtask #1
Wrong Answer
Score: 0
Test case #1
Wrong Answer
Score: 0
Time: 85 ms
Memory: 30464 KiB

Input file

84590 42147
aabbcb
ooxoxx
babbbc
xoxoxx
bbbabb
xoxoox
caaaca
xoxoxo
cbbaab
xxoooo
abcaac
ooxoox
acbc
<1678940 bytes omitted>

Output file

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

<84194 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #2
Wrong Answer
Score: 0
Time: 91 ms
Memory: 30476 KiB

Input file

83386 7411
acbccb
xooxxo
aaacac
ooxoxx
babaca
ooooox
bcccab
oooxoo
aababb
xooxox
aabbbc
ooxooo
abbbc
<1254249 bytes omitted>

Output file

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

<14722 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #3
Wrong Answer
Score: 0
Time: 89 ms
Memory: 30480 KiB

Input file

82181 39971
ccbacb
oxooox
cbabbc
oxooxo
acbbbb
ooxoxx
ccbcbc
ooxxox
bbbcab
oxxoox
accbac
ooooxx
bcca
<1619364 bytes omitted>

Output file

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

<79842 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #4
Wrong Answer
Score: 0
Time: 104 ms
Memory: 30728 KiB

Input file

99997 100000
aaccbb
ooooox
caabac
ooxoxo
bbcbcc
oxoxoo
aabbcb
xoxooo
bbccaa
xoxoxo
bbbbcb
xxxxoo
bcc
<2578001 bytes omitted>

Output file

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

<199900 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #5
Wrong Answer
Score: 0
Time: 86 ms
Memory: 30480 KiB

Input file

99999 99998
cacaca
oxooxo
abbcab
oxooox
ccbccc
xxooox
cbbbbb
ooxxox
cbcccc
xooxxo
bcaaca
oxooox
abac
<2578006 bytes omitted>

Output file

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

<199896 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Subtask #2
Wrong Answer
Score: 0
Test case #1
Wrong Answer
Score: 0
Time: 85 ms
Memory: 30464 KiB

Input file

84590 42147
aabbcb
ooxoxx
babbbc
xoxoxx
bbbabb
xoxoox
caaaca
xoxoxo
cbbaab
xxoooo
abcaac
ooxoox
acbc
<1678940 bytes omitted>

Output file

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

<84194 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #2
Wrong Answer
Score: 0
Time: 91 ms
Memory: 30476 KiB

Input file

83386 7411
acbccb
xooxxo
aaacac
ooxoxx
babaca
ooooox
bcccab
oooxoo
aababb
xooxox
aabbbc
ooxooo
abbbc
<1254249 bytes omitted>

Output file

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

<14722 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #3
Wrong Answer
Score: 0
Time: 104 ms
Memory: 30728 KiB

Input file

99997 100000
aaccbb
ooooox
caabac
ooxoxo
bbcbcc
oxoxoo
aabbcb
xoxooo
bbccaa
xoxoxo
bbbbcb
xxxxoo
bcc
<2578001 bytes omitted>

Output file

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

<199900 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #4
Wrong Answer
Score: 0
Time: 86 ms
Memory: 30480 KiB

Input file

99999 99998
cacaca
oxooxo
abbcab
oxooox
ccbccc
xxooox
cbbbbb
ooxxox
cbcccc
xooxxo
bcaaca
oxooox
abac
<2578006 bytes omitted>

Output file

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

<199896 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #5
Wrong Answer
Score: 0
Time: 89 ms
Memory: 30480 KiB

Input file

36673 94424
fbefbf
xoxxox
cedcdf
xxoxox
cfcfba
xxxxxo
cbceda
xoxxoo
dadcda
oxoxox
eebaae
xxooxx
fded
<1589112 bytes omitted>

Output file

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

<188748 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #6
Wrong Answer
Score: 0
Time: 88 ms
Memory: 30544 KiB

Input file

35469 26985
cbaeba
oxooxo
accfde
oxxooo
daebbf
oooxxo
bdddcf
xoxxoo
effaff
ooxoxx
acdfdc
oxxooo
aaba
<803588 bytes omitted>

Output file

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

<53870 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #7
Wrong Answer
Score: 0
Time: 123 ms
Memory: 30736 KiB

Input file

88751 98586
aaacde
oxoxox
dcfdfc
oxxxxx
babdba
oooooo
fcedfe
xxxxxx
acffbb
oxxxoo
fecccd
xxxxxo
dacf
<2400756 bytes omitted>

Output file

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

<197072 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #8
Wrong Answer
Score: 0
Time: 81 ms
Memory: 30476 KiB

Input file

99998 99997
fbcfcf
ooxxox
eccdde
xxxxoo
dfbcbe
ooxxoo
fffcaf
xoxxox
faacab
oxoxox
dafeaf
ooooxx
ccac
<2577652 bytes omitted>

Output file

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

<199894 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #9
Wrong Answer
Score: 0
Time: 83 ms
Memory: 30692 KiB

Input file

99993 99997
fcbcea
xoooxo
edacfa
xoxoxo
bfccfd
oxooxo
cabbca
ooooxx
eacdee
xoooxx
dbcffa
oooxxo
ceae
<2577464 bytes omitted>

Output file

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

<199894 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #10
Wrong Answer
Score: 0
Time: 93 ms
Memory: 30480 KiB

Input file

4 4
abcdee
xxxxox
abcdee
oxxxxx
abcdee
xxxxxx
aabcde
oxxxxx
1 1
2 2
3 3
4 4

Output file

6
1
6
6

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #11
Wrong Answer
Score: 0
Time: 96 ms
Memory: 30608 KiB

Input file

1 1
abcdef
xxxxxx
1 1

Output file

-1

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Subtask #3
Wrong Answer
Score: 0
Test case #1
Wrong Answer
Score: 0
Time: 85 ms
Memory: 30464 KiB

Input file

84590 42147
aabbcb
ooxoxx
babbbc
xoxoxx
bbbabb
xoxoox
caaaca
xoxoxo
cbbaab
xxoooo
abcaac
ooxoox
acbc
<1678940 bytes omitted>

Output file

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

<84194 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #2
Wrong Answer
Score: 0
Time: 91 ms
Memory: 30476 KiB

Input file

83386 7411
acbccb
xooxxo
aaacac
ooxoxx
babaca
ooooox
bcccab
oooxoo
aababb
xooxox
aabbbc
ooxooo
abbbc
<1254249 bytes omitted>

Output file

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

<14722 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #3
Wrong Answer
Score: 0
Time: 104 ms
Memory: 30728 KiB

Input file

99997 100000
aaccbb
ooooox
caabac
ooxoxo
bbcbcc
oxoxoo
aabbcb
xoxooo
bbccaa
xoxoxo
bbbbcb
xxxxoo
bcc
<2578001 bytes omitted>

Output file

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

<199900 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #4
Wrong Answer
Score: 0
Time: 86 ms
Memory: 30480 KiB

Input file

99999 99998
cacaca
oxooxo
abbcab
oxooox
ccbccc
xxooox
cbbbbb
ooxxox
cbcccc
xooxxo
bcaaca
oxooox
abac
<2578006 bytes omitted>

Output file

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

<199896 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #5
Wrong Answer
Score: 0
Time: 89 ms
Memory: 30480 KiB

Input file

36673 94424
fbefbf
xoxxox
cedcdf
xxoxox
cfcfba
xxxxxo
cbceda
xoxxoo
dadcda
oxoxox
eebaae
xxooxx
fded
<1589112 bytes omitted>

Output file

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

<188748 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #6
Wrong Answer
Score: 0
Time: 87 ms
Memory: 30588 KiB

Input file

17541 11593
bbcaac
oxoxoo
ccabac
ooxooo
bcbacb
xoxooo
ccabba
oooxox
babaca
xxooox
cbacab
ooxoox
bcca
<369890 bytes omitted>

Output file

4
4
4
4
4
5
3
6
4
4
4
4
2
-1
5
4
5
3
2
2
2
1
-1
5
5
4
-1
4
6
5
-1
-1
5
-1
4
3
4
5
4
-1
5
-1
4
4
5
-1
<24894 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #7
Wrong Answer
Score: 0
Time: 92 ms
Memory: 30476 KiB

Input file

99997 99992
baaabc
oxxxoo
cbcbab
oxxoxo
bbbbcc
xxooox
abaabb
xoxxxo
abccca
xoxoxx
bbbaaa
oxoxxx
cbab
<2577694 bytes omitted>

Output file

1
-1
3
3
4
3
3
2
2
-1
3
3
3
2
3
2
3
4
-1
2
2
3
3
-1
3
-1
3
3
-1
2
4
-1
3
3
-1
3
1
0
1
4
3
2
3
1
3
2

<216400 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #8
Wrong Answer
Score: 0
Time: 92 ms
Memory: 30476 KiB

Input file

99998 99993
babbcc
oxxxox
bcbabb
xooxxx
ccccab
xxoxxo
bcbbcc
xxooox
bbbbba
oxoxxx
aaacab
xxxoxo
abcc
<2577579 bytes omitted>

Output file

2
3
2
2
2
2
-1
1
2
2
2
2
-1
2
2
2
-1
2
2
2
2
2
3
-1
2
2
3
1
2
-1
2
2
2
2
2
2
-1
3
2
2
2
2
3
2
1
-1
2
<217609 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #9
Wrong Answer
Score: 0
Time: 110 ms
Memory: 30604 KiB

Input file

14 7
aaaaaa
oooooo
aabbcc
ooxxxx
aaaaaa
ooooox
aabbbb
ooxxox
aabbcc
oxoxoo
bbbbcc
xoxoxo
aabbcc
oooo
<134 bytes omitted>

Output file

6
6
-1
4
-1
-1
-1

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Subtask #4
Wrong Answer
Score: 0
Test case #1
Wrong Answer
Score: 0
Time: 90 ms
Memory: 30612 KiB

Input file

2 2
aabbcc
oxoxox
dddeee
ooxxxx
1 1
1 2

Output file

3
6

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #2
Wrong Answer
Score: 0
Time: 85 ms
Memory: 30464 KiB

Input file

84590 42147
aabbcb
ooxoxx
babbbc
xoxoxx
bbbabb
xoxoox
caaaca
xoxoxo
cbbaab
xxoooo
abcaac
ooxoox
acbc
<1678940 bytes omitted>

Output file

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

<84194 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #3
Wrong Answer
Score: 0
Time: 91 ms
Memory: 30476 KiB

Input file

83386 7411
acbccb
xooxxo
aaacac
ooxoxx
babaca
ooooox
bcccab
oooxoo
aababb
xooxox
aabbbc
ooxooo
abbbc
<1254249 bytes omitted>

Output file

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

<14722 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #4
Wrong Answer
Score: 0
Time: 104 ms
Memory: 30728 KiB

Input file

99997 100000
aaccbb
ooooox
caabac
ooxoxo
bbcbcc
oxoxoo
aabbcb
xoxooo
bbccaa
xoxoxo
bbbbcb
xxxxoo
bcc
<2578001 bytes omitted>

Output file

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

<199900 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #5
Wrong Answer
Score: 0
Time: 86 ms
Memory: 30480 KiB

Input file

99999 99998
cacaca
oxooxo
abbcab
oxooox
ccbccc
xxooox
cbbbbb
ooxxox
cbcccc
xooxxo
bcaaca
oxooox
abac
<2578006 bytes omitted>

Output file

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

<199896 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #6
Wrong Answer
Score: 0
Time: 89 ms
Memory: 30480 KiB

Input file

36673 94424
fbefbf
xoxxox
cedcdf
xxoxox
cfcfba
xxxxxo
cbceda
xoxxoo
dadcda
oxoxox
eebaae
xxooxx
fded
<1589112 bytes omitted>

Output file

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

<188748 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #7
Wrong Answer
Score: 0
Time: 88 ms
Memory: 30544 KiB

Input file

35469 26985
cbaeba
oxooxo
accfde
oxxooo
daebbf
oooxxo
bdddcf
xoxxoo
effaff
ooxoxx
acdfdc
oxxooo
aaba
<803588 bytes omitted>

Output file

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

<53870 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #8
Wrong Answer
Score: 0
Time: 123 ms
Memory: 30736 KiB

Input file

88751 98586
aaacde
oxoxox
dcfdfc
oxxxxx
babdba
oooooo
fcedfe
xxxxxx
acffbb
oxxxoo
fecccd
xxxxxo
dacf
<2400756 bytes omitted>

Output file

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

<197072 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #9
Wrong Answer
Score: 0
Time: 81 ms
Memory: 30476 KiB

Input file

99998 99997
fbcfcf
ooxxox
eccdde
xxxxoo
dfbcbe
ooxxoo
fffcaf
xoxxox
faacab
oxoxox
dafeaf
ooooxx
ccac
<2577652 bytes omitted>

Output file

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

<199894 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #10
Wrong Answer
Score: 0
Time: 83 ms
Memory: 30692 KiB

Input file

99993 99997
fcbcea
xoooxo
edacfa
xoxoxo
bfccfd
oxooxo
cabbca
ooooxx
eacdee
xoooxx
dbcffa
oooxxo
ceae
<2577464 bytes omitted>

Output file

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

<199894 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #11
Wrong Answer
Score: 0
Time: 87 ms
Memory: 30588 KiB

Input file

17541 11593
bbcaac
oxoxoo
ccabac
ooxooo
bcbacb
xoxooo
ccabba
oooxox
babaca
xxooox
cbacab
ooxoox
bcca
<369890 bytes omitted>

Output file

4
4
4
4
4
5
3
6
4
4
4
4
2
-1
5
4
5
3
2
2
2
1
-1
5
5
4
-1
4
6
5
-1
-1
5
-1
4
3
4
5
4
-1
5
-1
4
4
5
-1
<24894 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #12
Wrong Answer
Score: 0
Time: 92 ms
Memory: 30476 KiB

Input file

99997 99992
baaabc
oxxxoo
cbcbab
oxxoxo
bbbbcc
xxooox
abaabb
xoxxxo
abccca
xoxoxx
bbbaaa
oxoxxx
cbab
<2577694 bytes omitted>

Output file

1
-1
3
3
4
3
3
2
2
-1
3
3
3
2
3
2
3
4
-1
2
2
3
3
-1
3
-1
3
3
-1
2
4
-1
3
3
-1
3
1
0
1
4
3
2
3
1
3
2

<216400 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #13
Wrong Answer
Score: 0
Time: 92 ms
Memory: 30476 KiB

Input file

99998 99993
babbcc
oxxxox
bcbabb
xooxxx
ccccab
xxoxxo
bcbbcc
xxooox
bbbbba
oxoxxx
aaacab
xxxoxo
abcc
<2577579 bytes omitted>

Output file

2
3
2
2
2
2
-1
1
2
2
2
2
-1
2
2
2
-1
2
2
2
2
2
3
-1
2
2
3
1
2
-1
2
2
2
2
2
2
-1
3
2
2
2
2
3
2
1
-1
2
<217609 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #14
Wrong Answer
Score: 0
Time: 114 ms
Memory: 30692 KiB

Input file

70828 65903
cedfca
ooxooo
abbfba
oxxoxx
fddfad
xxxoox
bcbcbb
ooxoxx
ebcdce
oxoxox
fbeeff
xxxooo
aebf
<1761814 bytes omitted>

Output file

6
1
5
5
4
3
3
4
4
4
4
3
-1
4
4
-1
4
4
6
-1
5
3
2
-1
3
1
4
-1
1
4
5
5
3
2
3
4
4
3
4
3
-1
-1
2
4
5
3
3
<140089 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #15
Wrong Answer
Score: 0
Time: 88 ms
Memory: 30584 KiB

Input file

69624 31167
cafeab
ooxoxo
afabfa
oxxoxx
baefbe
oooxxo
dfacfe
xxooxo
cfaaca
oxoxxo
cbddad
xoxxox
dabb
<1338647 bytes omitted>

Output file

3
-1
5
4
6
4
5
-1
4
3
4
5
4
3
5
4
4
2
5
3
4
-1
4
2
4
4
1
3
4
3
6
-1
3
4
5
6
2
4
6
4
4
4
-1
5
5
3
4
3
<66198 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #16
Wrong Answer
Score: 0
Time: 98 ms
Memory: 30580 KiB

Input file

99998 99999
cbeacb
oxxoox
deceaa
oxoxoo
ecaeef
xooxxo
bafafd
xoxooo
fdbbfd
xxxxoo
cccece
oxxxox
ccdc
<2577321 bytes omitted>

Output file

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

<212373 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #17
Wrong Answer
Score: 0
Time: 93 ms
Memory: 30480 KiB

Input file

99999 99997
cbbebc
oxxxxo
babfee
xoxxox
feabdc
xxxxoo
caaded
ooooxx
facada
xooooo
baeafd
xoxoxo
efea
<2577655 bytes omitted>

Output file

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

<212453 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #18
Wrong Answer
Score: 0
Time: 97 ms
Memory: 30472 KiB

Input file

99994 99994
fddbbd
ooxoxo
ffbced
xxoooo
afbcfb
xoxoxo
dffffc
oxxoxo
fdeceb
ooooxo
dfccff
ooxoxx
bdab
<2577440 bytes omitted>

Output file

4
5
5
2
5
5
6
-1
4
3
2
4
2
4
3
3
4
6
3
5
4
3
2
-1
5
-1
-1
5
4
5
3
4
4
5
5
6
4
5
6
5
4
5
3
-1
5
5
4
5
<213092 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #19
Wrong Answer
Score: 0
Time: 86 ms
Memory: 30592 KiB

Input file

99999 99991
ffeafe
xxxoox
ddfccc
oxoxxo
becbbe
oxooox
cabbeb
ooxoxo
ccfabb
oxooox
bdbdbc
ooxxoo
ceba
<2577761 bytes omitted>

Output file

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

<213061 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #20
Wrong Answer
Score: 0
Time: 93 ms
Memory: 30480 KiB

Input file

4 4
abcdee
xxxxox
abcdee
oxxxxx
abcdee
xxxxxx
aabcde
oxxxxx
1 1
2 2
3 3
4 4

Output file

6
1
6
6

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #21
Wrong Answer
Score: 0
Time: 110 ms
Memory: 30604 KiB

Input file

14 7
aaaaaa
oooooo
aabbcc
ooxxxx
aaaaaa
ooooox
aabbbb
ooxxox
aabbcc
oxoxoo
bbbbcc
xoxoxo
aabbcc
oooo
<134 bytes omitted>

Output file

6
6
-1
4
-1
-1
-1

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #22
Wrong Answer
Score: 0
Time: 89 ms
Memory: 30476 KiB

Input file

8 4
aaaaaa
ooooox
bcdeaa
xxxxoo
aaabbb
oooxxx
ccddee
xxxxxx
aaaaab
ooooox
ccddee
xxxxxx
aaaaab
ooooo
<32 bytes omitted>

Output file

6
3
5
6

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #23
Wrong Answer
Score: 0
Time: 110 ms
Memory: 30720 KiB

Input file

2 1
abcdef
oooooo
abcdee
oooooo
1 2

Output file

-1

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #24
Wrong Answer
Score: 0
Time: 96 ms
Memory: 30608 KiB

Input file

1 1
abcdef
xxxxxx
1 1

Output file

-1

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #25
Wrong Answer
Score: 0
Time: 104 ms
Memory: 30604 KiB

Input file

2 1
abcdef
xxxxxx
abcdef
xxxxxx
1 2

Output file

-1

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Subtask #5
Wrong Answer
Score: 0
Test case #1
Wrong Answer
Score: 0
Time: 90 ms
Memory: 30612 KiB

Input file

2 2
aabbcc
oxoxox
dddeee
ooxxxx
1 1
1 2

Output file

3
6

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #2
Wrong Answer
Score: 0
Time: 85 ms
Memory: 30464 KiB

Input file

84590 42147
aabbcb
ooxoxx
babbbc
xoxoxx
bbbabb
xoxoox
caaaca
xoxoxo
cbbaab
xxoooo
abcaac
ooxoox
acbc
<1678940 bytes omitted>

Output file

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

<84194 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #3
Wrong Answer
Score: 0
Time: 91 ms
Memory: 30476 KiB

Input file

83386 7411
acbccb
xooxxo
aaacac
ooxoxx
babaca
ooooox
bcccab
oooxoo
aababb
xooxox
aabbbc
ooxooo
abbbc
<1254249 bytes omitted>

Output file

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

<14722 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #4
Wrong Answer
Score: 0
Time: 104 ms
Memory: 30728 KiB

Input file

99997 100000
aaccbb
ooooox
caabac
ooxoxo
bbcbcc
oxoxoo
aabbcb
xoxooo
bbccaa
xoxoxo
bbbbcb
xxxxoo
bcc
<2578001 bytes omitted>

Output file

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

<199900 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #5
Wrong Answer
Score: 0
Time: 86 ms
Memory: 30480 KiB

Input file

99999 99998
cacaca
oxooxo
abbcab
oxooox
ccbccc
xxooox
cbbbbb
ooxxox
cbcccc
xooxxo
bcaaca
oxooox
abac
<2578006 bytes omitted>

Output file

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

<199896 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #6
Wrong Answer
Score: 0
Time: 89 ms
Memory: 30480 KiB

Input file

36673 94424
fbefbf
xoxxox
cedcdf
xxoxox
cfcfba
xxxxxo
cbceda
xoxxoo
dadcda
oxoxox
eebaae
xxooxx
fded
<1589112 bytes omitted>

Output file

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

<188748 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #7
Wrong Answer
Score: 0
Time: 88 ms
Memory: 30544 KiB

Input file

35469 26985
cbaeba
oxooxo
accfde
oxxooo
daebbf
oooxxo
bdddcf
xoxxoo
effaff
ooxoxx
acdfdc
oxxooo
aaba
<803588 bytes omitted>

Output file

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

<53870 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #8
Wrong Answer
Score: 0
Time: 123 ms
Memory: 30736 KiB

Input file

88751 98586
aaacde
oxoxox
dcfdfc
oxxxxx
babdba
oooooo
fcedfe
xxxxxx
acffbb
oxxxoo
fecccd
xxxxxo
dacf
<2400756 bytes omitted>

Output file

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

<197072 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #9
Wrong Answer
Score: 0
Time: 81 ms
Memory: 30476 KiB

Input file

99998 99997
fbcfcf
ooxxox
eccdde
xxxxoo
dfbcbe
ooxxoo
fffcaf
xoxxox
faacab
oxoxox
dafeaf
ooooxx
ccac
<2577652 bytes omitted>

Output file

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

<199894 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #10
Wrong Answer
Score: 0
Time: 83 ms
Memory: 30692 KiB

Input file

99993 99997
fcbcea
xoooxo
edacfa
xoxoxo
bfccfd
oxooxo
cabbca
ooooxx
eacdee
xoooxx
dbcffa
oooxxo
ceae
<2577464 bytes omitted>

Output file

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

<199894 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #11
Wrong Answer
Score: 0
Time: 87 ms
Memory: 30588 KiB

Input file

17541 11593
bbcaac
oxoxoo
ccabac
ooxooo
bcbacb
xoxooo
ccabba
oooxox
babaca
xxooox
cbacab
ooxoox
bcca
<369890 bytes omitted>

Output file

4
4
4
4
4
5
3
6
4
4
4
4
2
-1
5
4
5
3
2
2
2
1
-1
5
5
4
-1
4
6
5
-1
-1
5
-1
4
3
4
5
4
-1
5
-1
4
4
5
-1
<24894 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #12
Wrong Answer
Score: 0
Time: 92 ms
Memory: 30476 KiB

Input file

99997 99992
baaabc
oxxxoo
cbcbab
oxxoxo
bbbbcc
xxooox
abaabb
xoxxxo
abccca
xoxoxx
bbbaaa
oxoxxx
cbab
<2577694 bytes omitted>

Output file

1
-1
3
3
4
3
3
2
2
-1
3
3
3
2
3
2
3
4
-1
2
2
3
3
-1
3
-1
3
3
-1
2
4
-1
3
3
-1
3
1
0
1
4
3
2
3
1
3
2

<216400 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #13
Wrong Answer
Score: 0
Time: 92 ms
Memory: 30476 KiB

Input file

99998 99993
babbcc
oxxxox
bcbabb
xooxxx
ccccab
xxoxxo
bcbbcc
xxooox
bbbbba
oxoxxx
aaacab
xxxoxo
abcc
<2577579 bytes omitted>

Output file

2
3
2
2
2
2
-1
1
2
2
2
2
-1
2
2
2
-1
2
2
2
2
2
3
-1
2
2
3
1
2
-1
2
2
2
2
2
2
-1
3
2
2
2
2
3
2
1
-1
2
<217609 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #14
Wrong Answer
Score: 0
Time: 114 ms
Memory: 30692 KiB

Input file

70828 65903
cedfca
ooxooo
abbfba
oxxoxx
fddfad
xxxoox
bcbcbb
ooxoxx
ebcdce
oxoxox
fbeeff
xxxooo
aebf
<1761814 bytes omitted>

Output file

6
1
5
5
4
3
3
4
4
4
4
3
-1
4
4
-1
4
4
6
-1
5
3
2
-1
3
1
4
-1
1
4
5
5
3
2
3
4
4
3
4
3
-1
-1
2
4
5
3
3
<140089 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #15
Wrong Answer
Score: 0
Time: 88 ms
Memory: 30584 KiB

Input file

69624 31167
cafeab
ooxoxo
afabfa
oxxoxx
baefbe
oooxxo
dfacfe
xxooxo
cfaaca
oxoxxo
cbddad
xoxxox
dabb
<1338647 bytes omitted>

Output file

3
-1
5
4
6
4
5
-1
4
3
4
5
4
3
5
4
4
2
5
3
4
-1
4
2
4
4
1
3
4
3
6
-1
3
4
5
6
2
4
6
4
4
4
-1
5
5
3
4
3
<66198 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #16
Wrong Answer
Score: 0
Time: 98 ms
Memory: 30580 KiB

Input file

99998 99999
cbeacb
oxxoox
deceaa
oxoxoo
ecaeef
xooxxo
bafafd
xoxooo
fdbbfd
xxxxoo
cccece
oxxxox
ccdc
<2577321 bytes omitted>

Output file

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

<212373 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #17
Wrong Answer
Score: 0
Time: 93 ms
Memory: 30480 KiB

Input file

99999 99997
cbbebc
oxxxxo
babfee
xoxxox
feabdc
xxxxoo
caaded
ooooxx
facada
xooooo
baeafd
xoxoxo
efea
<2577655 bytes omitted>

Output file

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

<212453 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #18
Wrong Answer
Score: 0
Time: 97 ms
Memory: 30472 KiB

Input file

99994 99994
fddbbd
ooxoxo
ffbced
xxoooo
afbcfb
xoxoxo
dffffc
oxxoxo
fdeceb
ooooxo
dfccff
ooxoxx
bdab
<2577440 bytes omitted>

Output file

4
5
5
2
5
5
6
-1
4
3
2
4
2
4
3
3
4
6
3
5
4
3
2
-1
5
-1
-1
5
4
5
3
4
4
5
5
6
4
5
6
5
4
5
3
-1
5
5
4
5
<213092 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #19
Wrong Answer
Score: 0
Time: 86 ms
Memory: 30592 KiB

Input file

99999 99991
ffeafe
xxxoox
ddfccc
oxoxxo
becbbe
oxooox
cabbeb
ooxoxo
ccfabb
oxooox
bdbdbc
ooxxoo
ceba
<2577761 bytes omitted>

Output file

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

<213061 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #20
Wrong Answer
Score: 0
Time: 107 ms
Memory: 30600 KiB

Input file

42234 34548
baaaac
ooxxxx
abcbca
xoxoxo
acbcaa
xxoxxo
bacccc
ooxxxx
bccaba
oxxxoo
bcaaac
oxoxxx
abbc
<987843 bytes omitted>

Output file

-1
3
-1
3
3
3
3
-1
3
3
3
3
3
3
-1
3
-1
-1
3
-1
3
3
-1
3
3
3
3
3
3
-1
3
3
3
3
3
-1
3
3
-1
3
3
3
3
-1

<82054 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #21
Wrong Answer
Score: 0
Time: 106 ms
Memory: 30728 KiB

Input file

90012 9353
bbbbcc
xxxxoo
bbcbcb
xxoxox
abbaba
oxxxxo
bcbbac
xoxxoo
ccbacb
ooxoxx
babccc
xoxxoo
cccbc
<1369973 bytes omitted>

Output file

-1
4
-1
4
4
4
-1
-1
4
4
-1
-1
4
4
3
-1
4
4
4
4
-1
4
4
4
4
-1
4
4
4
-1
4
4
4
4
4
-1
-1
-1
4
-1
4
4
4

<22008 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #22
Wrong Answer
Score: 0
Time: 102 ms
Memory: 30480 KiB

Input file

99995 99992
bbbccc
xxxooo
acbcbc
ooxoxo
cbabca
oxoxoo
abcbca
oxoxoo
aaaabc
xxooxo
bbccbb
xxooxx
abca
<2577796 bytes omitted>

Output file

5
5
5
-1
-1
5
5
5
5
4
-1
-1
-1
5
5
-1
5
-1
5
5
5
-1
-1
4
5
5
5
5
-1
5
5
-1
-1
5
5
5
-1
5
5
-1
5
5
-1
<239463 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #23
Wrong Answer
Score: 0
Time: 91 ms
Memory: 30476 KiB

Input file

73896 69983
caccbc
xoxoox
aabaaa
xoooxo
ccbaaa
xooooo
bacaab
xooooo
acbbac
oooxox
cbccab
xooxox
cbca
<1839239 bytes omitted>

Output file

5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5

<139866 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #24
Wrong Answer
Score: 0
Time: 108 ms
Memory: 30732 KiB

Input file

56804 97814
aacaca
oooooo
bcaacb
xoooox
cacbcc
xooxxo
bccaac
xoxooo
acbbbc
ooxxxo
acccba
oxooxo
bcba
<1910183 bytes omitted>

Output file

6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6

<195528 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #25
Wrong Answer
Score: 0
Time: 95 ms
Memory: 30468 KiB

Input file

99999 99994
baaabb
xxxoxx
ccbaca
ooxxoo
abcaba
xxoxxo
abcbba
oxoxxx
abcaab
xxooxx
aaaaac
xoxxxo
aaab
<2559863 bytes omitted>

Output file

4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4

<199888 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #26
Wrong Answer
Score: 0
Time: 92 ms
Memory: 30600 KiB

Input file

99992 99995
caabba
oxxoxo
cccaab
oooxoo
bacbac
xoooxo
cbccbb
oxooox
acacab
xoxooo
cababb
oxxoxo
aaca
<2559852 bytes omitted>

Output file

5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5

<199890 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #27
Wrong Answer
Score: 0
Time: 93 ms
Memory: 30480 KiB

Input file

4 4
abcdee
xxxxox
abcdee
oxxxxx
abcdee
xxxxxx
aabcde
oxxxxx
1 1
2 2
3 3
4 4

Output file

6
1
6
6

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #28
Wrong Answer
Score: 0
Time: 110 ms
Memory: 30604 KiB

Input file

14 7
aaaaaa
oooooo
aabbcc
ooxxxx
aaaaaa
ooooox
aabbbb
ooxxox
aabbcc
oxoxoo
bbbbcc
xoxoxo
aabbcc
oooo
<134 bytes omitted>

Output file

6
6
-1
4
-1
-1
-1

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #29
Wrong Answer
Score: 0
Time: 89 ms
Memory: 30476 KiB

Input file

8 4
aaaaaa
ooooox
bcdeaa
xxxxoo
aaabbb
oooxxx
ccddee
xxxxxx
aaaaab
ooooox
ccddee
xxxxxx
aaaaab
ooooo
<32 bytes omitted>

Output file

6
3
5
6

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #30
Wrong Answer
Score: 0
Time: 110 ms
Memory: 30720 KiB

Input file

2 1
abcdef
oooooo
abcdee
oooooo
1 2

Output file

-1

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #31
Wrong Answer
Score: 0
Time: 96 ms
Memory: 30608 KiB

Input file

1 1
abcdef
xxxxxx
1 1

Output file

-1

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #32
Wrong Answer
Score: 0
Time: 104 ms
Memory: 30604 KiB

Input file

2 1
abcdef
xxxxxx
abcdef
xxxxxx
1 2

Output file

-1

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Subtask #6
Wrong Answer
Score: 0
Test case #1
Wrong Answer
Score: 0
Time: 90 ms
Memory: 30612 KiB

Input file

2 2
aabbcc
oxoxox
dddeee
ooxxxx
1 1
1 2

Output file

3
6

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #2
Wrong Answer
Score: 0
Time: 85 ms
Memory: 30464 KiB

Input file

84590 42147
aabbcb
ooxoxx
babbbc
xoxoxx
bbbabb
xoxoox
caaaca
xoxoxo
cbbaab
xxoooo
abcaac
ooxoox
acbc
<1678940 bytes omitted>

Output file

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

<84194 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #3
Wrong Answer
Score: 0
Time: 91 ms
Memory: 30476 KiB

Input file

83386 7411
acbccb
xooxxo
aaacac
ooxoxx
babaca
ooooox
bcccab
oooxoo
aababb
xooxox
aabbbc
ooxooo
abbbc
<1254249 bytes omitted>

Output file

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

<14722 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #4
Wrong Answer
Score: 0
Time: 104 ms
Memory: 30728 KiB

Input file

99997 100000
aaccbb
ooooox
caabac
ooxoxo
bbcbcc
oxoxoo
aabbcb
xoxooo
bbccaa
xoxoxo
bbbbcb
xxxxoo
bcc
<2578001 bytes omitted>

Output file

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

<199900 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #5
Wrong Answer
Score: 0
Time: 86 ms
Memory: 30480 KiB

Input file

99999 99998
cacaca
oxooxo
abbcab
oxooox
ccbccc
xxooox
cbbbbb
ooxxox
cbcccc
xooxxo
bcaaca
oxooox
abac
<2578006 bytes omitted>

Output file

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

<199896 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #6
Wrong Answer
Score: 0
Time: 89 ms
Memory: 30480 KiB

Input file

36673 94424
fbefbf
xoxxox
cedcdf
xxoxox
cfcfba
xxxxxo
cbceda
xoxxoo
dadcda
oxoxox
eebaae
xxooxx
fded
<1589112 bytes omitted>

Output file

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

<188748 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #7
Wrong Answer
Score: 0
Time: 88 ms
Memory: 30544 KiB

Input file

35469 26985
cbaeba
oxooxo
accfde
oxxooo
daebbf
oooxxo
bdddcf
xoxxoo
effaff
ooxoxx
acdfdc
oxxooo
aaba
<803588 bytes omitted>

Output file

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

<53870 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #8
Wrong Answer
Score: 0
Time: 123 ms
Memory: 30736 KiB

Input file

88751 98586
aaacde
oxoxox
dcfdfc
oxxxxx
babdba
oooooo
fcedfe
xxxxxx
acffbb
oxxxoo
fecccd
xxxxxo
dacf
<2400756 bytes omitted>

Output file

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

<197072 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #9
Wrong Answer
Score: 0
Time: 81 ms
Memory: 30476 KiB

Input file

99998 99997
fbcfcf
ooxxox
eccdde
xxxxoo
dfbcbe
ooxxoo
fffcaf
xoxxox
faacab
oxoxox
dafeaf
ooooxx
ccac
<2577652 bytes omitted>

Output file

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

<199894 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #10
Wrong Answer
Score: 0
Time: 83 ms
Memory: 30692 KiB

Input file

99993 99997
fcbcea
xoooxo
edacfa
xoxoxo
bfccfd
oxooxo
cabbca
ooooxx
eacdee
xoooxx
dbcffa
oooxxo
ceae
<2577464 bytes omitted>

Output file

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

<199894 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #11
Wrong Answer
Score: 0
Time: 87 ms
Memory: 30588 KiB

Input file

17541 11593
bbcaac
oxoxoo
ccabac
ooxooo
bcbacb
xoxooo
ccabba
oooxox
babaca
xxooox
cbacab
ooxoox
bcca
<369890 bytes omitted>

Output file

4
4
4
4
4
5
3
6
4
4
4
4
2
-1
5
4
5
3
2
2
2
1
-1
5
5
4
-1
4
6
5
-1
-1
5
-1
4
3
4
5
4
-1
5
-1
4
4
5
-1
<24894 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #12
Wrong Answer
Score: 0
Time: 92 ms
Memory: 30476 KiB

Input file

99997 99992
baaabc
oxxxoo
cbcbab
oxxoxo
bbbbcc
xxooox
abaabb
xoxxxo
abccca
xoxoxx
bbbaaa
oxoxxx
cbab
<2577694 bytes omitted>

Output file

1
-1
3
3
4
3
3
2
2
-1
3
3
3
2
3
2
3
4
-1
2
2
3
3
-1
3
-1
3
3
-1
2
4
-1
3
3
-1
3
1
0
1
4
3
2
3
1
3
2

<216400 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #13
Wrong Answer
Score: 0
Time: 92 ms
Memory: 30476 KiB

Input file

99998 99993
babbcc
oxxxox
bcbabb
xooxxx
ccccab
xxoxxo
bcbbcc
xxooox
bbbbba
oxoxxx
aaacab
xxxoxo
abcc
<2577579 bytes omitted>

Output file

2
3
2
2
2
2
-1
1
2
2
2
2
-1
2
2
2
-1
2
2
2
2
2
3
-1
2
2
3
1
2
-1
2
2
2
2
2
2
-1
3
2
2
2
2
3
2
1
-1
2
<217609 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #14
Wrong Answer
Score: 0
Time: 114 ms
Memory: 30692 KiB

Input file

70828 65903
cedfca
ooxooo
abbfba
oxxoxx
fddfad
xxxoox
bcbcbb
ooxoxx
ebcdce
oxoxox
fbeeff
xxxooo
aebf
<1761814 bytes omitted>

Output file

6
1
5
5
4
3
3
4
4
4
4
3
-1
4
4
-1
4
4
6
-1
5
3
2
-1
3
1
4
-1
1
4
5
5
3
2
3
4
4
3
4
3
-1
-1
2
4
5
3
3
<140089 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #15
Wrong Answer
Score: 0
Time: 88 ms
Memory: 30584 KiB

Input file

69624 31167
cafeab
ooxoxo
afabfa
oxxoxx
baefbe
oooxxo
dfacfe
xxooxo
cfaaca
oxoxxo
cbddad
xoxxox
dabb
<1338647 bytes omitted>

Output file

3
-1
5
4
6
4
5
-1
4
3
4
5
4
3
5
4
4
2
5
3
4
-1
4
2
4
4
1
3
4
3
6
-1
3
4
5
6
2
4
6
4
4
4
-1
5
5
3
4
3
<66198 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #16
Wrong Answer
Score: 0
Time: 98 ms
Memory: 30580 KiB

Input file

99998 99999
cbeacb
oxxoox
deceaa
oxoxoo
ecaeef
xooxxo
bafafd
xoxooo
fdbbfd
xxxxoo
cccece
oxxxox
ccdc
<2577321 bytes omitted>

Output file

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

<212373 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #17
Wrong Answer
Score: 0
Time: 93 ms
Memory: 30480 KiB

Input file

99999 99997
cbbebc
oxxxxo
babfee
xoxxox
feabdc
xxxxoo
caaded
ooooxx
facada
xooooo
baeafd
xoxoxo
efea
<2577655 bytes omitted>

Output file

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

<212453 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #18
Wrong Answer
Score: 0
Time: 97 ms
Memory: 30472 KiB

Input file

99994 99994
fddbbd
ooxoxo
ffbced
xxoooo
afbcfb
xoxoxo
dffffc
oxxoxo
fdeceb
ooooxo
dfccff
ooxoxx
bdab
<2577440 bytes omitted>

Output file

4
5
5
2
5
5
6
-1
4
3
2
4
2
4
3
3
4
6
3
5
4
3
2
-1
5
-1
-1
5
4
5
3
4
4
5
5
6
4
5
6
5
4
5
3
-1
5
5
4
5
<213092 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #19
Wrong Answer
Score: 0
Time: 86 ms
Memory: 30592 KiB

Input file

99999 99991
ffeafe
xxxoox
ddfccc
oxoxxo
becbbe
oxooox
cabbeb
ooxoxo
ccfabb
oxooox
bdbdbc
ooxxoo
ceba
<2577761 bytes omitted>

Output file

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

<213061 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #20
Wrong Answer
Score: 0
Time: 107 ms
Memory: 30600 KiB

Input file

42234 34548
baaaac
ooxxxx
abcbca
xoxoxo
acbcaa
xxoxxo
bacccc
ooxxxx
bccaba
oxxxoo
bcaaac
oxoxxx
abbc
<987843 bytes omitted>

Output file

-1
3
-1
3
3
3
3
-1
3
3
3
3
3
3
-1
3
-1
-1
3
-1
3
3
-1
3
3
3
3
3
3
-1
3
3
3
3
3
-1
3
3
-1
3
3
3
3
-1

<82054 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #21
Wrong Answer
Score: 0
Time: 106 ms
Memory: 30728 KiB

Input file

90012 9353
bbbbcc
xxxxoo
bbcbcb
xxoxox
abbaba
oxxxxo
bcbbac
xoxxoo
ccbacb
ooxoxx
babccc
xoxxoo
cccbc
<1369973 bytes omitted>

Output file

-1
4
-1
4
4
4
-1
-1
4
4
-1
-1
4
4
3
-1
4
4
4
4
-1
4
4
4
4
-1
4
4
4
-1
4
4
4
4
4
-1
-1
-1
4
-1
4
4
4

<22008 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #22
Wrong Answer
Score: 0
Time: 102 ms
Memory: 30480 KiB

Input file

99995 99992
bbbccc
xxxooo
acbcbc
ooxoxo
cbabca
oxoxoo
abcbca
oxoxoo
aaaabc
xxooxo
bbccbb
xxooxx
abca
<2577796 bytes omitted>

Output file

5
5
5
-1
-1
5
5
5
5
4
-1
-1
-1
5
5
-1
5
-1
5
5
5
-1
-1
4
5
5
5
5
-1
5
5
-1
-1
5
5
5
-1
5
5
-1
5
5
-1
<239463 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #23
Wrong Answer
Score: 0
Time: 91 ms
Memory: 30476 KiB

Input file

73896 69983
caccbc
xoxoox
aabaaa
xoooxo
ccbaaa
xooooo
bacaab
xooooo
acbbac
oooxox
cbccab
xooxox
cbca
<1839239 bytes omitted>

Output file

5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5

<139866 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #24
Wrong Answer
Score: 0
Time: 108 ms
Memory: 30732 KiB

Input file

56804 97814
aacaca
oooooo
bcaacb
xoooox
cacbcc
xooxxo
bccaac
xoxooo
acbbbc
ooxxxo
acccba
oxooxo
bcba
<1910183 bytes omitted>

Output file

6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6

<195528 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #25
Wrong Answer
Score: 0
Time: 95 ms
Memory: 30468 KiB

Input file

99999 99994
baaabb
xxxoxx
ccbaca
ooxxoo
abcaba
xxoxxo
abcbba
oxoxxx
abcaab
xxooxx
aaaaac
xoxxxo
aaab
<2559863 bytes omitted>

Output file

4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4
4

<199888 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #26
Wrong Answer
Score: 0
Time: 92 ms
Memory: 30600 KiB

Input file

99992 99995
caabba
oxxoxo
cccaab
oooxoo
bacbac
xoooxo
cbccbb
oxooox
acacab
xoxooo
cababb
oxxoxo
aaca
<2559852 bytes omitted>

Output file

5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5
5

<199890 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #27
Wrong Answer
Score: 0
Time: 90 ms
Memory: 30584 KiB

Input file

91025 9592
edefaa
ooooox
ccdcfb
xxoxox
fbeeba
oxooxo
acbacd
xxxoxo
bcedde
xxoxoo
fbdccd
oxxxxo
ccddd
<1387111 bytes omitted>

Output file

6
6
6
-1
6
6
-1
6
-1
6
6
6
6
-1
6
6
-1
-1
-1
6
6
6
6
-1
-1
6
6
-1
6
6
6
6
6
6
-1
6
6
4
-1
6
6
6
-1
6
<22717 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #28
Wrong Answer
Score: 0
Time: 85 ms
Memory: 30480 KiB

Input file

38802 92909
fadfbf
oxoxxo
adebca
xooxxx
adbedb
xxxoox
cbbdfc
xxxoox
eadcba
oxoxxx
dedbce
ooxxxo
fbaf
<1605521 bytes omitted>

Output file

-1
-1
-1
5
6
6
6
-1
-1
-1
6
6
6
-1
5
-1
6
6
6
4
6
6
-1
-1
1
2
6
-1
4
6
-1
-1
-1
6
-1
6
6
4
6
6
-1
6

<220162 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #29
Wrong Answer
Score: 0
Time: 111 ms
Memory: 30596 KiB

Input file

99999 99992
ffffba
xxxoxx
dfbcdf
oxxoxo
edeceb
xoooox
eaddef
oxoxoo
cbeabb
oxoxxx
ceabca
ooxxox
cbba
<2577947 bytes omitted>

Output file

-1
6
6
-1
6
6
-1
-1
-1
6
-1
6
6
6
6
6
6
4
-1
-1
-1
6
-1
-1
6
6
-1
6
6
6
6
6
4
6
6
6
-1
6
-1
6
6
-1
4
<237903 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #30
Wrong Answer
Score: 0
Time: 90 ms
Memory: 30604 KiB

Input file

26338 39260
aefadc
xooxxo
edefef
oxxoxo
dcecce
xoxooo
dffeff
xxooxo
bedaed
xoxxxx
cadbfc
oxxxoo
fdaa
<799668 bytes omitted>

Output file

6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6

<78420 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #31
Wrong Answer
Score: 0
Time: 96 ms
Memory: 30712 KiB

Input file

52350 67092
effaad
oxooox
cddbcf
xxxooo
eeffdd
oxxoxx
abaeda
ooooxx
acfbae
oooooo
acefcc
ooooxx
cebc
<1495122 bytes omitted>

Output file

6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6

<134084 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #32
Wrong Answer
Score: 0
Time: 96 ms
Memory: 30724 KiB

Input file

99993 99992
becdca
ooooxo
ebaebf
xoooxo
bbfefa
xoooxo
abdeea
xooxoo
deaddc
xooxoo
cdafad
oxooxo
acef
<2559531 bytes omitted>

Output file

6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6

<199884 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #33
Wrong Answer
Score: 0
Time: 95 ms
Memory: 30604 KiB

Input file

99993 99993
ffbadd
ooxxxo
cbbacf
xxxxxo
dabbde
oxxxxo
edcded
oxxxoo
fcceda
oxxoox
bdcdcb
xoxxxx
defb
<2559890 bytes omitted>

Output file

6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6
6

<199886 bytes omitted>

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #34
Wrong Answer
Score: 0
Time: 93 ms
Memory: 30480 KiB

Input file

4 4
abcdee
xxxxox
abcdee
oxxxxx
abcdee
xxxxxx
aabcde
oxxxxx
1 1
2 2
3 3
4 4

Output file

6
1
6
6

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #35
Wrong Answer
Score: 0
Time: 110 ms
Memory: 30604 KiB

Input file

14 7
aaaaaa
oooooo
aabbcc
ooxxxx
aaaaaa
ooooox
aabbbb
ooxxox
aabbcc
oxoxoo
bbbbcc
xoxoxo
aabbcc
oooo
<134 bytes omitted>

Output file

6
6
-1
4
-1
-1
-1

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #36
Wrong Answer
Score: 0
Time: 89 ms
Memory: 30476 KiB

Input file

8 4
aaaaaa
ooooox
bcdeaa
xxxxoo
aaabbb
oooxxx
ccddee
xxxxxx
aaaaab
ooooox
ccddee
xxxxxx
aaaaab
ooooo
<32 bytes omitted>

Output file

6
3
5
6

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #37
Wrong Answer
Score: 0
Time: 110 ms
Memory: 30720 KiB

Input file

2 1
abcdef
oooooo
abcdee
oooooo
1 2

Output file

-1

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #38
Wrong Answer
Score: 0
Time: 96 ms
Memory: 30608 KiB

Input file

1 1
abcdef
xxxxxx
1 1

Output file

-1

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1
Test case #39
Wrong Answer
Score: 0
Time: 104 ms
Memory: 30604 KiB

Input file

2 1
abcdef
xxxxxx
abcdef
xxxxxx
1 2

Output file

-1

Stderr message

Traceback (most recent call last):
  File "/sandbox/2/a.py", line 2, in <module>
    a=input(),strip()
NameError: name 'strip' is not defined

Checker message

Files user_out and answer differ

System message

Exited with return code 1