# data[].attributes.attachment_link.readable_text
with open("CHUOIKT.INP","w+") as file:
    file.write("7\nabcdef\nbbbcc\nolympic\nabcdef\nbbbcc\nabcdef\nabcdef")
    file.seek(0)
    ds=file.readlines()[1:]
ds=[i.strip() for i in ds]
for i in ds:
    dem=ds.count(i)
    if dem%2==1:
        with open("CHUOIKT.OUT","w") as file:
            file.write(i)
        break
            

# data[].attributes.body
CHUOIKT.PY

# data[].attributes.attachment_link.readable_text
fi=open('CHUOIKT.INP')
fo=open('CHUOIKT.OUT','w')
n=int(fi.readline())
a=list(fi.read().split())
dem={}
for i in range(0,n):
    a[i].strip()
    if a[i] in dem:
        dem[a[i]]+=1
    else:
        dem[a[i]]=1
for s,i in dem.items():
    if i%2!=0:
        fo.write(f'{s}')
fi.close()
fo.close()

# data[].attributes.attachment_link.readable_text
fi=open('CHUOIKT.INP')
fo=open('CHUOIKT.OUT','w')
n=int(fi.readline())
a=[]
for i in range(0,n):
    a.append(fi.readline().split())
for i in range(0,n):
    if a.count(a[i])%2!=0:
        fo.write(f'{a[i][0]}')
fi.close()
fo.close()

# data[].attributes.attachment_link.readable_text
n=int(input("nh���p n: "))
s=""
for i in range(1,n+1):
    s+=str(i)
print(s)
while len(s)>1:
    snew=""
    for i in range(0,len(s),2):
        snew+=s[i]
    s=snew
    snew=""
    for i in range(1,len(s),2):
        snew+=s[i]
    s=snew
print(s)

# data[].attributes.attachment_link.readable_text
fi=open("hoanvi.inp.txt")
fo=open("hoanvi.out.txt","w")
a,b=map(int,fi.readline().split())
d=int(fi.readline())
data=[]
for i in range(1,a+1):
    data.append(i)
from itertools import  permutations
kq=list(permutations(data))
h=[]
for x in kq:
    print(x)
    x=int(''.join(map(str,x)))
    h.append(x)
print(h)
for j in range(0,len(h)-1):
    if h[j]%b==0 and d<h[j]:
        fo.write(str(h[j]))
        break
fo.close()
fi.close()
    

# data[].attributes.attachment_link.readable_text
fi=open("chuoi.inp.txt")
fo=open("chuoi.out.txt","w")
a=(int,fi.readline().split())
b=list(map(str,fi.read().split()))
print(b)
for i in range(0,len(b)-1):
    print(i)
    if b.count(b[i])%2==1:
        fo.write(b[i])
fo.close()
fi.close()

# data[].attributes.attachment_link.readable_text
fi=open("bangso.inp.txt")
fo=open("bangso.out.txt","w")
a=int(fi.readline())
m=list(map(int,fi.readline().split()))
print(m)
maxc=max(m)
tong=0
dem=0
for i in range(0,len(m)-1):
    tong+=m[i]
    if tong>maxc:
        tong-=m[i]
        dem+=1
        tong=0
        i+1
    if tong<maxc:
        tong+=m[i]
print(dem)

# data[].attributes.attachment_link.readable_text
from itertools import permutations
fi=open('HOANVI.INP')
fo=open('HOANVI.OUT','w')
n,k=map(int,fi.readline().split())
x=int(fi.readline())
a=[]
b=[]
for i in range(1,n+1):
    b.append(i)
hv=permutations(b)
for s in hv:
    s=int(''.join(map(str,s)))
    a.append(s)
for i in range(0,len(a)):
    if a[i]%k==0 and a[i]>x:
        fo.write(f'{a[i]}')
        break
fi.close()
fo.close()

# data[].attributes.attachment_link.readable_text
with open("DAYCON.INP","w+") as file:
    file.write("11\n1\n4\n10\n8\n3\n4\n3\n1\n1\n2\n5")
    file.seek(0)
    ds=list(map(int,file.readlines()[1:]))
mxlen=0
vtr=0
while vtr<len(ds)-1:
    dem=1
    for i in range(vtr,len(ds)-1):
        if ds[i]<=ds[i+1]:
            dem+=1
        else: break
    if mxlen<dem:
        mxlen=dem
    vtr+=1
with open("DAYCON.OUT","w") as file:
    file.write(str(mxlen))

# data[].attributes.attachment_link.readable_text
def tangdan(s):
    for i in range(0,len(s)-1):
        if s[i]>s[i+1]:
            return False
    return True
fi=open('DAYCON.INP')
fo=open('DAYCON.OUT','w')
n=int(fi.readline())
a=[]
for i in range(0,n):
    a.append(int(fi.readline()))
mx=0
for i in range(0,n-1):
    for j in range(i+1,n):
        if tangdan(a[i:j+1]) and mx<len(a[i:j+1]):
            mx=len(a[i:j+1])
print(mx)

        

# data[].attributes.body
DAYCON.PY

# data[].attributes.attachment_link.readable_text
def kttd(a):
    for i in range(0,len(a)-1):
        if a[i]>a[i+1]:
            return False
    return True
fi=open('DAYCON.INP')
fo=open('DAYCON.OUT','w')
n=int(fi.readline())
a=[]
for i in range(0,n):
    a.append(int(fi.readline()))
dd=0
for i in range(0,n-1):
    for j in range(i+1,n):
        if kttd(a[i:j+1]) and dd<len(a[i:j]):
            dd=len(a[i:j+1])
fo.write(f'{dd}')
fi.close()
fo.close()

# data[].attributes.body
DAYCON.PY

# data[].attributes.attachment_link.readable_text
def kttd(a):
    for i in range(0,len(a)-1):
        if a[i]>a[i+1]:
            return False
    return True
fi=open('DAYCON.INP')
fo=open('DAYCON.OUT','w')
n=int(fi.readline())
a=[]
for i in range(0,n):
    a.append(int(fi.readline()))
dd=0
for i in range(0,n-1):
    for j in range(i+1,n):
        if kttd(a[i:j+1]) and dd<len(a[i:j]):
            dd=len(a[i:j+1])
fo.write(f'{dd}')
fi.close()
fo.close()

# data[].attributes.attachment_link.readable_text
def ktrdxung(s):
    return s==s[::-1]
fi=open('CHUOI.INP')
fo=open('CHUOI.OUT','w')
n=int(fi.readline())
a=fi.readline()
mx=0
for i in range(0,n-1):
    for j in range(i+1,n):
        if ktrdxung(a[i:j+1]) and mx<len(a[i:j+1]):
            mx=len(a[i:j+1])
fo.write(f'{mx}')
fi.close()
fo.close()

# data[].attributes.attachment_link.readable_text
with open("CHUOI.INP","w+") as file:
    file.write("18\nIKACOBEGIGEBOCAHTM")
    file.seek(0)
    x=file.readlines()[1].strip()
def doixung(x):
    return x==x[::-1]
dem=0
for i in range(len(x)-1):
    for j in range(i+1,len(x)):
        if doixung(x[i:j+1]) and dem<len(x[i:j+1]):
            dem=len(x[i:j+1])
with open("CHUOI.OUT","w") as file:
    file.write(str(dem))

# data[].attributes.body
CHUOI.PY

# data[].attributes.attachment_link.readable_text
def ktdx(a):
    return a==a[::-1]
fi=open('CHUOI.INP')
fo=open('CHUOI.OUT','w')
n=int(fi.readline())
a=fi.readline()
dem=0
for i in range(0,n-1):
    for j in range(i+1,n):
        if ktdx(a[i:j+1])and dem<len(a[i:j+1]):
            dem=len(a[i:j+1])
            
fo.write(f'{dem}')        
fi.close()
fo.close()

# data[].attributes.attachment_link.readable_text
fi=open("BAI6.INP")
fo=open("BAI6.OUT","w")
n=list(map(int,fi.readline().split()))
a=list(map(int,fi.readline().split()))
	
m=a[0]
for i in range(0,len(a)):
	for j in range(i+1,len(a)+1):
		if sum(a[i:j])>m and len(a[i:j])==3:
			m=sum(a[i:j])
print(m)
fo.write(str(m))
fi.close()
fo.close()