Submission details
Task:Freight trains
Sender:aalto26em_005
Submission time:2026-09-28 17:45:12 +0300
Language:Python3 (PyPy3)
Status:READY
Result:
Test results
testverdicttime
#1ACCEPTED0.04 sdetails
#20.04 sdetails
#30.04 sdetails
#40.04 sdetails
#50.04 sdetails
#60.04 sdetails
#70.04 sdetails
#80.04 sdetails
#90.04 sdetails
#100.04 sdetails
#110.04 sdetails
#120.04 sdetails
#130.04 sdetails
#140.04 sdetails
#150.04 sdetails
#160.04 sdetails
#170.04 sdetails
#180.04 sdetails
#190.06 sdetails
#200.04 sdetails
#210.06 sdetails
#220.04 sdetails
#230.04 sdetails
#240.04 sdetails
#250.04 sdetails
#260.04 sdetails
#270.04 sdetails
#280.04 sdetails
#290.06 sdetails
#300.04 sdetails
#310.06 sdetails
#320.06 sdetails
#330.06 sdetails
#340.06 sdetails
#350.06 sdetails
#360.04 sdetails
#370.06 sdetails
#380.04 sdetails
#390.06 sdetails
#400.06 sdetails
#410.06 sdetails
#420.07 sdetails
#430.07 sdetails
#440.06 sdetails
#450.06 sdetails
#460.07 sdetails
#470.07 sdetails
#480.07 sdetails
#490.07 sdetails
#500.07 sdetails
#510.06 sdetails
#520.07 sdetails
#530.07 sdetails
#540.07 sdetails
#550.07 sdetails
#560.07 sdetails
#570.07 sdetails
#580.07 sdetails
#590.07 sdetails
#600.07 sdetails
#610.07 sdetails
#620.13 sdetails
#630.13 sdetails
#640.14 sdetails
#650.13 sdetails
#660.13 sdetails
#670.14 sdetails
#680.13 sdetails
#690.14 sdetails
#700.14 sdetails
#710.14 sdetails

Code

n = int(input())
ids = []
for _ in range(n):
    ids.append(input())
ids.sort()

def compare(j=0):
    if j >= len(ids)-1:
        return ids.pop()
    s1 = ids[j]
    s2 = ids[j+1]
    if s1[0] == s2[len(s1)]:
        return compare(j+1)
    elif s1[0] < s2[len(s1)]:
        return ids.pop(j)
    else:
        return ids.pop(j+1)
    
res = ""
while (len(ids) > 1):
    s1 = ids[0]
    s2 = ids[1]
    print(s1,s2)
    if len(s1) != len(s2) and s2[:len(s1)]==s1:    
        res += compare()
    else:
        res += s1
        ids.pop(0)
        continue
    print(res)
res += ids.pop()
print(res)

Test details

Test 1

Verdict: ACCEPTED

input
1
gl

correct output
gl

user output
gl

Test 2

Verdict:

input
2
adedf
ff

correct output
adedfff

user output
adedf ff
adedfff

Test 3

Verdict:

input
2
jb
lj

correct output
jblj

user output
jb lj
jblj

Test 4

Verdict:

input
2
qlipb
sr

correct output
qlipbsr

user output
qlipb sr
qlipbsr

Test 5

Verdict:

input
3
f
llk
onfj

correct output
fllkonfj

user output
f llk
llk onfj
fllkonfj

Test 6

Verdict:

input
3
jaeo
mob
nk

correct output
jaeomobnk

user output
jaeo mob
mob nk
jaeomobnk

Test 7

Verdict:

input
3
nemlo
psqhy
sg

correct output
nemlopsqhysg

user output
nemlo psqhy
psqhy sg
nemlopsqhysg

Test 8

Verdict:

input
4
dia
eh
fbcae
gf

correct output
diaehfbcaegf

user output
dia eh
eh fbcae
fbcae gf
diaehfbcaegf

Test 9

Verdict:

input
4
c
cbfaa
egbg
fc

correct output
cbfaacegbgfc

user output
c cbfaa
cbfaa
c egbg
egbg fc
cbfaacegbgfc

Test 10

Verdict:

input
4
cbc
cdd
ceed
dbeea

correct output
cbccddceeddbeea

user output
cbc cdd
cdd ceed
ceed dbeea
cbccddceeddbeea

Test 11

Verdict:

input
4
bfec
bgbaf
fcg
fdbbg

correct output
bfecbgbaffcgfdbbg

user output
bfec bgbaf
bgbaf fcg
fcg fdbbg
bfecbgbaffcgfdbbg

Test 12

Verdict:

input
5
aoefh
ge
imgjj
kmj
...

correct output
aoefhgeimgjjkmjmhhi

user output
aoefh ge
ge imgjj
imgjj kmj
kmj mhhi
aoefhgeimgjjkmjmhhi

Test 13

Verdict:

input
5
bcbec
ei
fdigc
ilabd
...

correct output
bcbeceifdigcilabdlg

user output
bcbec ei
ei fdigc
fdigc ilabd
ilabd lg
bcbeceifdigcilabdlg

Test 14

Verdict:

input
5
a
d
db
glfff
...

correct output
adbdglfffih

user output
a d
d db
adb
d glfff
glfff ih
...

Test 15

Verdict:

input
5
ab
d
ebhin
k
...

correct output
abdebhinknab

user output
ab d
d ebhin
ebhin k
k nab
abdebhinknab

Test 16

Verdict:

input
5
fasgx
o
oezws
qua
...

correct output
fasgxoezwsoquaspfd

user output
fasgx o
o oezws
fasgxoezws
o qua
qua spfd
...

Test 17

Verdict:

input
5
bcggd
dcg
e
fc
...

correct output
bcggddcgefcg

user output
bcggd dcg
dcg e
e fc
fc g
bcggddcgefcg

Test 18

Verdict:

input
5
cmo
cx
hftbb
mil
...

correct output
cmocxhftbbmiltksr

user output
cmo cx
cx hftbb
hftbb mil
mil tksr
cmocxhftbbmiltksr

Test 19

Verdict:

input
5
ab
ababa
b
ca
...

correct output
ababaabbcaccb

user output
ab ababa

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 20

Verdict:

input
5
o
rjj
sfj
ti
...

correct output
orjjsfjtiw

user output
o rjj
rjj sfj
sfj ti
ti w
orjjsfjtiw

Test 21

Verdict:

input
5
a
aa
aaa
abbab
...

correct output
aaaaaaabbabba

user output
a aa

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 22

Verdict:

input
10
aoefh
f
ge
hlmgh
...

correct output
aoefhfgehlmghimgjjjkmjmhhinmol...

user output
aoefh f
f ge
ge hlmgh
hlmgh imgjj
imgjj j
...

Test 23

Verdict:

input
10
bcbec
cjjil
dbigk
ei
...

correct output
bcbeccjjildbigkeifdigcgfbikfil...

user output
bcbec cjjil
cjjil dbigk
dbigk ei
ei fdigc
fdigc gfb
...

Test 24

Verdict:

input
10
a
cij
d
db
...

correct output
acijdbddhhekcgibfgglfffihkg

user output
a cij
cij d
d db
acijdb
d dhh
...

Test 25

Verdict:

input
10
ab
d
ebhin
fk
...

correct output
abdebhinfkgjdinaiodgkacknab

user output
ab d
d ebhin
ebhin fk
fk gjd
gjd ina
...

Test 26

Verdict:

input
10
buywl
fasgx
gb
jzpek
...

correct output
buywlfasgxgbjzpekoezwsoquaspfd...

user output
buywl fasgx
fasgx gb
gb jzpek
jzpek o
o oezws
...

Test 27

Verdict:

input
10
acg
bcggd
dcg
dede
...

correct output
acgbcggddcgdedeefcfdbbfgabbg

user output
acg bcggd
bcggd dcg
dcg dede
dede e
e f
...

Test 28

Verdict:

input
10
cmo
cx
dpr
dtir
...

correct output
cmocxdprdtirhftbbmfmiltksrttkb...

user output
cmo cx
cx dpr
dpr dtir
dtir hftbb
hftbb mf
...

Test 29

Verdict:

input
10
ab
ababa
abbc
b
...

correct output
ababaababbcbbbcaccbcccccc

user output
ab ababa

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 30

Verdict:

input
10
dmq
gl
j
jqso
...

correct output
dmqgljjqsoorjjsfjtiulvw

user output
dmq gl
gl j
j jqso
dmqglj
jqso o
...

Test 31

Verdict:

input
10
a
aa
aaa
abbab
...

correct output
aaaaaaabbabbabbabbabbbbbabbbbb

user output
a aa

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 32

Verdict:

input
100
aa
acmfac
afmolcn
alllbndbli
...

correct output
aaacmfacafmolcnalllbndbliamdal...

user output
aa acmfac
acmfac afmolcn
afmolcn alllbndbli
alllbndbli amdalfoklc
amdalfoklc aoefhlmhh
...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 33

Verdict:

input
100
a
acjgj
ae
aegdb
...

correct output
aacjgjaeaegdbafcbahledfchagaja...

user output
a acjgj
a
acjgj ae
ae aegdb
aacjgjae
...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 34

Verdict:

input
100
a
aah
abaeeaifc
abajl
...

correct output
aaahabaeeaifcabajlaehaejcdegka...

user output
a aah
aah
a abaeeaifc
aaha
abaeeaifc abajl
...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 35

Verdict:

input
100
a
aa
abg
abndfmmmk
...

correct output
aaaabgabndfmmmkacggjdeacogeada...

user output
a aa
aa
a abg
aaa
abg abndfmmmk
...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 36

Verdict:

input
100
afn
aic
ajrkgzldb
amcyqyh
...

correct output
afnaicajrkgzldbamcyqyhandanxhj...

user output
afn aic
aic ajrkgzldb
ajrkgzldb amcyqyh
amcyqyh and
and anxhjoe
...

Test 37

Verdict:

input
100
aacdeffdd
abaacbae
abfbbff
ac
...

correct output
aacdeffddabaacbaeabfbbffacacbg...

user output
aacdeffdd abaacbae
abaacbae abfbbff
abfbbff ac
ac acbgff
aacdeffddabaacbaeabfbbffac
...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 38

Verdict:

input
100
abnfxhutgk
ajkdoqmdqp
asxeblm
badpwpsqhn
...

correct output
abnfxhutgkajkdoqmdqpasxeblmbad...

user output
abnfxhutgk ajkdoqmdqp
ajkdoqmdqp asxeblm
asxeblm badpwpsqhn
badpwpsqhn bhwqfmat
bhwqfmat biqhdvi
...

Test 39

Verdict:

input
100
a
aa
aaaaacaca
aaaabcabc
...

correct output
aaaaaaaacacaaaaabcabcaaabaaaab...

user output
a aa

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 40

Verdict:

input
100
a
aiesfhkro
aivvkdc
ajrtj
...

correct output
aaiesfhkroaivvkdcajrtjaqfnivlb...

user output
a aiesfhkro
a
aiesfhkro aivvkdc
aivvkdc ajrtj
ajrtj aqfnivl
...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 41

Verdict:

input
100
a
aa
aaaa
aaaaa
...

correct output
aaaaaaaaaaaaaaaaaaaaaaaaaaabab...

user output
a aa

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  [Previous line repeated 1 more time]
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 42

Verdict:

input
200
a
aa
abbhjifdb
acmfac
...

correct output
aaaabbhjifdbacmfacadiadnhkaehh...

user output
a aa
aa
a abbhjifdb
aaa
abbhjifdb acmfac
...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 43

Verdict:

input
200
a
aa
abihiahg
acjgj
...

correct output
aaaabihiahgacjgjadaeaegdbafcba...

user output
a aa
aa
a abihiahg
aaa
abihiahg acjgj
...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 44

Verdict:

input
200
a
aah
abaeeaifc
abajl
...

correct output
aaahabaeeaifcabajlaehaejcdegka...

user output
a aah
aah
a abaeeaifc
aaha
abaeeaifc abajl
...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 45

Verdict:

input
200
a
aa
aan
abg
...

correct output
aaaaanabgabndfmmmkacggjdeacoge...

user output
a aa
aa
a aan

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 46

Verdict:

input
200
ad
aegewtfc
afn
aic
...

correct output
adaegewtfcafnaicajrkgzldbamcyq...

user output
ad aegewtfc
aegewtfc afn
afn aic
aic ajrkgzldb
ajrkgzldb amcyqyh
...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 47

Verdict:

input
200
a
aa
aacdeffdd
aaeceaeb
...

correct output
aaaaacdeffddaaeceaebabaacbaeab...

user output
a aa
aa
a aacdeffdd

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 48

Verdict:

input
200
abnfxhutgk
aghv
ajkdoqmdqp
ajpvvalnu
...

correct output
abnfxhutgkaghvajkdoqmdqpajpvva...

user output
abnfxhutgk aghv
aghv ajkdoqmdqp
ajkdoqmdqp ajpvvalnu
ajpvvalnu akdmlbddox
akdmlbddox aosde
...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 49

Verdict:

input
200
a
aa
aaaaacaca
aaaabcabc
...

correct output
aaaaaaaacacaaaaabcabcaaaacbcaa...

user output
a aa

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 50

Verdict:

input
200
a
abam
aiesfhkro
aivvkdc
...

correct output
aabamaiesfhkroaivvkdcajrtjakam...

user output
a abam
a
abam aiesfhkro
aiesfhkro aivvkdc
aivvkdc ajrtj
...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 51

Verdict:

input
200
a
aaicd
acbjfaj
achddjj
...

correct output
aaaicdacbjfajachddjjacifadaecf...

user output
a aaicd

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 52

Verdict:

input
1000
a
aa
aaccbkcd
aaj
...

correct output
aaaaaccbkcdaajaanabaabanikjabb...

user output
a aa
aa
a aaccbkcd

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 53

Verdict:

input
1000
a
aa
aabecajcf
aabg
...

correct output
aaaaabecajcfaabgaabjllgdlkaadg...

user output
a aa
aa
a aabecajcf

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 54

Verdict:

input
1000
a
aa
aablaga
aah
...

correct output
aaaaablagaaahaajaaklkjjababaee...

user output
a aa
aa
a aablaga

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 55

Verdict:

input
1000
a
aa
aagjd
aajdlmacjn
...

correct output
aaaaagjdaajdlmacjnaakjdngdfaal...

user output
a aa
aa
a aagjd
aaaagjd
a aajdlmacjn

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 56

Verdict:

input
1000
a
aalguz
abcce
abggxup
...

correct output
aaalguzabcceabggxupabujabxldxy...

user output
a aalguz

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 57

Verdict:

input
1000
a
aa
aaabaaaaf
aaaeb
...

correct output
aaaaaabaaaafaaaebaabeadaabfffd...

user output
a aa

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 58

Verdict:

input
1000
a
aamuthxggq
abnfxhutgk
adaumgqm
...

correct output
aaamuthxggqabnfxhutgkadaumgqma...

user output
a aamuthxggq

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 59

Verdict:

input
1000
a
aa
aaa
aaaa
...

correct output
aaaaaaaaaaaaaaaaaaaaaaaaaaabaa...

user output
a aa
aaaaaa
a aa

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  [Previous line repeated 2 more times]
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 60

Verdict:

input
1000
a
aanmhqqnpc
ab
abam
...

correct output
aaanmhqqnpcababamabginwqvvacba...

user output
a aanmhqqnpc

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 61

Verdict:

input
1000
a
aa
aaaca
aae
...

correct output
aaaaaacaaaeaaekcaagjeahdaahhdf...

user output
a aa

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 62

Verdict:

input
100000
a
aa
aaa
aaaagle
...

correct output
aaaaaaaaaagleaaabaaabiaaaaccgh...

user output
a aa

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 63

Verdict:

input
100000
a
aa
aaa
aaaagf
...

correct output
aaaaaaaaaagfaaaaihlblgaaaalkll...

user output
a aa
aaaagf
a aa

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 64

Verdict:

input
100000
a
aa
aaa
aaaa
...

correct output
aaaaaaaaaaaaaabkaaaaelbjbaaaaf...

user output
a aa
aaaa
a aa
aaaaaaaabk
a aa

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 65

Verdict:

input
100000
a
aa
aaa
aaaa
...

correct output
aaaaaaaaaaaaaahleaaaajaaabaaab...

user output
a aa
aaaa
a aa

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 66

Verdict:

input
100000
a
aa
aaa
aaacxrqz
...

correct output
aaaaaaaaacxrqzaaahaaaahaaaplto...

user output
a aa
aaa
a aa

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 67

Verdict:

input
100000
a
aa
aaa
aaaa
...

correct output
aaaaaaaaaaaaaaaaaaaaaadbaaaaaa...

user output
a aa
aaaaaaadb
a aa

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  [Previous line repeated 2 more times]
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 68

Verdict:

input
100000
a
aa
aaa
aaail
...

correct output
aaaaaaaaailaaaitehaeaaaitxaaam...

user output
a aa
aaa
a aa
aaaaaail
a aa

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 69

Verdict:

input
100000
a
aa
aaa
aaaa
...

correct output
aaaaaaaaaaaaaaabghaaaabcaffaaa...

user output
a aa
aaaaabgh
a aa
aaaaabghaaaa
a aa
...

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 70

Verdict:

input
100000
a
aa
aaa
aaaaggo
...

correct output
aaaaaaaaaaggoaaacwpgjkvaaaftbl...

user output
a aa
aaaaggo
a aa
aaaaggoaaa
a aa

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range

Test 71

Verdict:

input
100000
a
aa
aaa
aaaa
...

correct output
aaaaaaaaaaaaaabaaaagkaaabaaabb...

user output
a aa
aaaa
a aa
aaaaaaaab
a aa

Error:
Traceback (most recent call last):
  File "/box/input/code.py", line 25, in <module>
    res += compare()
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 13, in compare
    return compare(j+1)
  File "/box/input/code.py", line 12, in compare
    if s1[0] == s2[len(s1)]:
IndexError: string index out of range