Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
c1=[int(i) for i in input().split()]
c2=[int(i) for i in input().split()]
d=[(0,0,1),(-1,0,0),(0,1,0),(0,-1,0),(1,0,0),(0,0,-1)]
def crosspro(y,x):
    return (y[1]*x[2]-y[2]*x[1],y[2]*x[0]-y[0]*x[2],y[0]*x[1]-y[1]*x[0])
def north(r):
    res=[]
    for p in r:
        res.append((p[2],p[1],-p[0]))
    return res
def south(r):
    res=[]
    for p in r:
        res.append((-p[2],p[1],p[0]))
    return res
def east(r):
    res=[]
    for p in r:
        res.append((p[0],p[2],-p[1]))
    return res
def west(r):
    res=[]
    for p in r:
        res.append((p[0],-p[2],p[1]))
    return res
def left(r):
    res=[]
    for p in r:
        res.append((p[1],-p[0],p[2]))
    return res
def right(r):
    res=[]
    for p in r:
        res.append((-p[1],p[0],p[2]))
    return res
T=["","N","E","W","S","NN"]
U=["","L","LL","LLL"]
def change(S):
    D=d
    for i in S:
        if i=="N":
            D=north(D)
        elif i=="E":
            D=east(D)
        elif i=="W":
            D=west(D)
        elif i=="S":
            D=south(D)
        elif i=="L":
            D=left(D)
        else:
            D=right(D)
    return D
for i in T:
    for j in U:
        D=change(i+j)
        flag=0
        for x in range(6):
            for y in range(6):
                if d[x]==D[y]:
                    if c1[x]!=c2[y]:
                        flag=1
        if flag==0:
            print("Yes")
            exit()
print("No")



Fixed submission:
c=[int(i) for i in input().split()]
S=input()
d=[(0,0,1),(-1,0,0),(0,1,0),(0,-1,0),(1,0,0),(0,0,-1)]
def north(r):
    res=[]
    for p in r:
        res.append((p[2],p[1],-p[0]))
    return res
def south(r):
    res=[]
    for p in r:
        res.append((-p[2],p[1],p[0]))
    return res
def east(r):
    res=[]
    for p in r:
        res.append((p[0],p[2],-p[1]))
    return res
def west(r):
    res=[]
    for p in r:
        res.append((p[0],-p[2],p[1]))
    return res
D=[i for i in d]
for i in S:
    if i=="N":
        D=north(D)
    elif i=="S":
        D=south(D)
    elif i=="W":
        D=west(D)
    else:
        D=east(D)
for k in range(6):
    if D[k]==(0,0,1):
        print(c[k])
Buggy python submission (verdict: Runtime Error):
x = raw_input()
print("{0}".format(x^3))

Fixed submission:
n=int(input())**3
print("{0}".format(n))

Buggy python submission (verdict: Runtime Error):
x = raw_input()
print("{0}".format(x^3))

Fixed submission:
n=int(input())**3
print("{0}".format(n))

Buggy python submission (verdict: Runtime Error):
x = int(raw_input())
y = x * x * x
print "{0}" .format(y)

Fixed submission:
n=int(input())**3
print("{0}".format(n))

Buggy python submission (verdict: Runtime Error):
x = int(raw_input())
print("{0}".format(x^3))

Fixed submission:
n=int(input())**3
print("{0}".format(n))
Buggy python submission (verdict: Runtime Error):
w="test"
a=[]
i=0
while(w!=""):
    w=input()
    a.append(w)
a.remove("")
for k in a:
    i+=1
    print("Case {0}: {1}".format(i,k))

Fixed submission:
w=114514
a=[]
i=0
while(w!=0):
    w=int(input())
    a.append(w)
a.remove(0)
for k in a:
    i+=1
    print("Case {0}: {1}".format(i,k))
Buggy python submission (verdict: Runtime Error):
import math
r=int(input())
print("{0} {1}".format(r**2*math.pi,2*r*math.pi))

Fixed submission:
import math
r=float(input())
print("{0} {1}".format(r**2*math.pi,2*r*math.pi))
Buggy python submission (verdict: Runtime Error):
def calc(s):
    t=s.split()
    a=int(t[0])
    b=int(t[2])
    op=t[1]
    if op=="+":
        return ("{0}".format(a+b))
    if op == "-":
        return ("{0}".format(a - b))
    if op == "*":
        return ("{0}".format(a * b))
    if op == "/":
        return ("{0}".format(a // b))
w="yjsnpi"
a=[]
while(w!="0 ? 0"):
    w=input()
    a.append(w)
a.remove("0 ? 0")
for st in a:
    print("{0}".format(calc(st)))

Fixed submission:
def calc(s):
    t=s.split()
    a=int(t[0])
    b=int(t[2])
    op=t[1]
    if op=="+":
        return ("{0}".format(a+b))
    if op == "-":
        return ("{0}".format(a - b))
    if op == "*":
        return ("{0}".format(a * b))
    if op == "/":
        return ("{0}".format(a // b))
w="yj s npi"
a=[]
while(w.split()[1]!="?"):
    w=input()
    a.append(w)
a.pop()
for st in a:
    print("{0}".format(calc(st)))

Buggy python submission (verdict: Runtime Error):
def calc(s):
    t=s.split()
    a=int(t[0])
    b=int(t[2])
    op=t[1]
    if op=="+":
        return ("{0}".format(a+b))
    if op == "-":
        return ("{0}".format(a - b))
    if op == "*":
        return ("{0}".format(a * b))
    if op == "/":
        return ("{0}".format(a // b))
w="yj s npi"
a=[]
while(w.split()[1]!="?"):
    w=input()
    a.append(w)
a.remove("0 ? 0")
for st in a:
    print("{0}".format(calc(st)))

Fixed submission:
def calc(s):
    t=s.split()
    a=int(t[0])
    b=int(t[2])
    op=t[1]
    if op=="+":
        return ("{0}".format(a+b))
    if op == "-":
        return ("{0}".format(a - b))
    if op == "*":
        return ("{0}".format(a * b))
    if op == "/":
        return ("{0}".format(a // b))
w="yj s npi"
a=[]
while(w.split()[1]!="?"):
    w=input()
    a.append(w)
a.pop()
for st in a:
    print("{0}".format(calc(st)))

Buggy python submission (verdict: Runtime Error):
def calc(s):
    t=s.split()
    a=int(t[0])
    b=int(t[2])
    op=t[1]
    if op=="+":
        return ("{0}".format(a+b))
    if op == "-":
        return ("{0}".format(a - b))
    if op == "*":
        return ("{0}".format(a * b))
    if op == "/":
        return ("{0}".format(a // b))
w="yj s npi"
a=[]
while(w.split()[1]!="?"):
    w=input()
    a.append(w)
a.remove("0 ? 0")
for st in a:
    print("{0}".format(calc(st)))

Fixed submission:
def calc(s):
    t=s.split()
    a=int(t[0])
    b=int(t[2])
    op=t[1]
    if op=="+":
        return ("{0}".format(a+b))
    if op == "-":
        return ("{0}".format(a - b))
    if op == "*":
        return ("{0}".format(a * b))
    if op == "/":
        return ("{0}".format(a // b))
w="yj s npi"
a=[]
while(w.split()[1]!="?"):
    w=input()
    a.append(w)
a.pop()
for st in a:
    print("{0}".format(calc(st)))
Buggy python submission (verdict: Runtime Error):
Import sys
my_str = input()

for i in range(len(my_str)):
    if "a"<=my_str[i]<="z":
        sys.stdout.write(my_str[i].upper(),end='')
    elif "A"<=my_str[i]<="Z":
        sys.stdout.write(my_str[i].lower(),end='')
    else:
        sys.stdout.write(my_str[i],end='')
sys.stdout.write("\n")

Fixed submission:
import sys
my_str = input()

for i in range(len(my_str)):
    if "a" <= my_str[i] <= "z":
        sys.stdout.write(my_str[i].upper())
    elif "A" <= my_str[i] <= "Z":
        sys.stdout.write(my_str[i].lower())
    else:
        sys.stdout.write(my_str[i])
sys.stdout.write("\n")
Buggy python submission (verdict: Runtime Error):
st="."
num = [0 for i in range(26)]
while(st!=""):
    st=input().lower()
    for k in range(len(st)):
        if ord(st[k])<=122 and ord(st[k])>=97:
            num[ord(st[k])-97]+=1

for i in range(26):
    print("{0} : {1}".format(chr(i+97),num[i]))

Fixed submission:
import sys
num = [0 for i in range(26)]
for str in sys.stdin:
    st=str.lower()
    for k in range(len(st)):
        if ord(st[k])<=122 and ord(st[k])>=97:
            num[ord(st[k])-97]+=1
for i in range(26):
    print("{0} : {1}".format(chr(i+97),num[i]))

Buggy python submission (verdict: Runtime Error):
st="."
num = [0 for i in range(26)]
while(st!=""):
    st=input().lower()
    for k in range(len(st)):
        if ord(st[k])<=122 and ord(st[k])>=97:
            num[ord(st[k])-97]+=1

for i in range(26):
    print("{0} : {1}".format(chr(i+97),num[i]))

Fixed submission:
import sys
num = [0 for i in range(26)]
for str in sys.stdin:
    st=str.lower()
    for k in range(len(st)):
        if ord(st[k])<=122 and ord(st[k])>=97:
            num[ord(st[k])-97]+=1
for i in range(26):
    print("{0} : {1}".format(chr(i+97),num[i]))
Buggy python submission (verdict: Runtime Error):
from math import pi

r = int(input())
print(pi * r ** 2, pi * r * 2)



Fixed submission:
from math import pi

r = float(input())
print(pi * r ** 2, pi * r * 2)
Buggy python submission (verdict: Runtime Error):
def orderN(N,L,ices):
    upPeak = L - ices[0]
    downPeak = L - ices[0]
    peaks = []
    for i in xrange(len(ices)):
        if i < N-1:
            if ices[i] < ices[i+1]:
                peaks.append(downPeak)
                downPeak = L - ices[i+1]
                upPeak += L - ices[i+1]
            else:
                peaks.append(upPeak)
                upPeak = L - ices[i+1]
                downPeak += L - ices[i+1]
        else:
            peaks.append(upPeak)
            peaks.append(downPeak)
    print(max(peaks))

N,L = map(int,rawinput().strip().split())
ices = []
while True:
    ice = int(rawinput().strip())
    ices.append(ice)
    if len(ices) == N:
        break

orderN(N,L,ices)

Fixed submission:
def orderN(N,L,ices):
    upPeak = L - ices[0]
    downPeak = L - ices[0]
    peaks = []
    append = peaks.append
    for i in xrange(len(ices)):
        if i < N-1:
            if ices[i] < ices[i+1]:
                append(downPeak)
                downPeak = L - ices[i+1]
                upPeak += L - ices[i+1]
            else:
                append(upPeak)
                upPeak = L - ices[i+1]
                downPeak += L - ices[i+1]
        else:
            append(upPeak)
            append(downPeak)
    print(max(peaks))

N,L = map(int,raw_input().strip().split())
ices = [int(raw_input().strip()) for _ in xrange(N)]

orderN(N,L,ices)

Buggy python submission (verdict: Runtime Error):
def orderN(N,L,ices):
    upPeak = L - ices[0]
    downPeak = L - ices[0]
    peaks = []
    for i in range(len(ices)):
        if i < N-1:
            if ices[i] < ices[i+1]:
                peaks.append(downPeak)
                downPeak = L - ices[i+1]
                upPeak += L - ices[i+1]
            elif ices[i] > ices[i+1]:
                peaks.append(upPeak)
                upPeak = L - ices[i+1]
                downPeak += L - ices[i+1]
        elif i == N-1:
            peaks.append(upPeak)
            peaks.append(downPeak)
    print(max(peaks))

N,L = map(int,input().strip().split())
ices = [int(raw_input().strip()) for _ in xrange(N)]

orderN(N,L,ices)

Fixed submission:
def orderN(N,L,ices):
    upPeak = L - ices[0]
    downPeak = L - ices[0]
    peaks = []
    append = peaks.append
    for i in xrange(len(ices)):
        if i < N-1:
            if ices[i] < ices[i+1]:
                append(downPeak)
                downPeak = L - ices[i+1]
                upPeak += L - ices[i+1]
            else:
                append(upPeak)
                upPeak = L - ices[i+1]
                downPeak += L - ices[i+1]
        else:
            append(upPeak)
            append(downPeak)
    print(max(peaks))

N,L = map(int,raw_input().strip().split())
ices = [int(raw_input().strip()) for _ in xrange(N)]

orderN(N,L,ices)
Buggy python submission (verdict: Runtime Error):
import time

N, Q = map(int, input().split())
SegTree = [0 for i in range(4*N)]

def modify(i, left, right, value, pos=-1):
    global SegTree
    if left==right:
        if pos != -1:
            SegTree[i] = value
        else:
            SegTree[i] = 2147483647
        return

    mid = int((left+right)/2)
    if pos==-1 or pos<=mid:
        modify(i*2, left, mid, value, pos)
    if pos==-1 or pos>mid:
        modify(i*2+1, mid+1, right, value, pos)
    
    SegTree[i] = min(SegTree[i*2], SegTree[i*2+1])

def query_min(i, L, R, left, right):
    if right < L or R < left:
        return 2147364748
    if left<=L and R<=right:
        return SegTree[i]
    mid = int((L+R)/2)
    return min(query_min(2*i, L, mid, left, right),
               query_min(2*i+1, mid+1, R, left, right))

modify(i=1, left=0, right=N-1, value=0, pos=-1) #init

for querys in range(Q):
    t, a, b = map(int, input().split())
    if t == 0:
        modify(i=1, left=0, right=N-1, pos=a, value=b)
    else:
        print( query_min(i=1, L=0, R=N-1, left=a, right=b) )

Fixed submission:
import time

N, Q = map(int, input().split())
SegTree = [0 for i in range(4*N)]

def modify(i, left, right, value, pos=-1):
    global SegTree
    if left==right:
        if pos != -1:
            SegTree[i] = value
        else:
            SegTree[i] = 2147483647
        return

    mid = int((left+right)/2)
    if pos==-1 or pos<=mid:
        modify(i*2, left, mid, value, pos)
    if pos==-1 or pos>mid:
        modify(i*2+1, mid+1, right, value, pos)
    
    SegTree[i] = min(SegTree[i*2], SegTree[i*2+1])

def query_min(i, L, R, left, right):
    if right < L or R < left:
        return 2147483647
    if left<=L and R<=right:
        return SegTree[i]
    mid = int((L+R)/2)
    return min(query_min(2*i, L, mid, left, right),
               query_min(2*i+1, mid+1, R, left, right))

modify(i=1, left=0, right=N-1, value=0, pos=-1) #init

for querys in range(Q):
    t, a, b = map(int, input().split())
    if t == 0:
        modify(i=1, left=0, right=N-1, pos=a, value=b)
    else:
        print( query_min(i=1, L=0, R=N-1, left=a, right=b) )
Buggy python submission (verdict: Time Limit Exceeded):
from math import floor
while(True):
    x,y,s=map(int,input().split())
    if (x,y,s)==(0,0,0):
        quit()
    ans=0
    for i in range(1,s):
        for j in range(1,s):
            if floor(i*(1+0.01*x))+floor(j*(1+0.01*x))==s:
                ans=max(ans,floor(i*(1+0.01*y))+floor(j*(1+0.01*y)))
    print(ans)



Fixed submission:
from math import floor
while(True):
    x,y,s=map(int,input().split())
    if (x,y,s)==(0,0,0):
        quit()
    ans=0
    for i in range(1,s):
        j=s-floor(i*(100+x)/100)
        if j<1:
            continue
        j=floor((j+1)*(100/(100+x)))
        for k in [j-1,j]:
            if floor(i*(100+x)/100)+floor(k*(100+x)/100)==s:
                ans=max(ans,floor(i*(100+y)/100)+floor(k*(100+y)/100))
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from math import floor
while(True):
    x,y,s=map(int,input().split())
    if (x,y,s)==(0,0,0):
        quit()
    ans=0
    for i in range(1,s):
        for j in range(1,s):
            if floor(i*(1+0.01*x))+floor(j*(1+0.01*x))==s:
                ans=max(ans,floor(i*(1+0.01*y))+floor(j*(1+0.01*y)))
    print(ans)



Fixed submission:
from math import floor
while(True):
    x,y,s=map(int,input().split())
    if (x,y,s)==(0,0,0):
        quit()
    ans=0
    for i in range(1,s):
        j=s-floor(i*(100+x)/100)
        if j<1:
            continue
        j=floor((j+1)*(100/(100+x)))
        for k in [j-1,j]:
            if floor(i*(100+x)/100)+floor(k*(100+x)/100)==s:
                ans=max(ans,floor(i*(100+y)/100)+floor(k*(100+y)/100))
    print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
from math import floor
while(True):
    x,y,s=map(int,input().split())
    if (x,y,s)==(0,0,0):
        quit()
    ans=0
    for i in range(1,s):
        for j in range(1,s):
            if floor(i*(1+0.01*x))+floor(j*(1+0.01*x))==s:
                ans=max(ans,floor(i*(1+0.01*y))+floor(j*(1+0.01*y)))
    print(ans)



Fixed submission:
from math import floor
while(True):
    x,y,s=map(int,input().split())
    if (x,y,s)==(0,0,0):
        quit()
    ans=0
    for i in range(1,s):
        j=s-floor(i*(100+x)/100)
        if j<1:
            continue
        j=floor((j+1)*(100/(100+x)))
        for k in [j-1,j]:
            if floor(i*(100+x)/100)+floor(k*(100+x)/100)==s:
                ans=max(ans,floor(i*(100+y)/100)+floor(k*(100+y)/100))
    print(ans)
Buggy python submission (verdict: Runtime Error):
def d(p, q):
    return pos[p] - pos[q]

def solve():
    p0, p1, p2 = 0, 0, 0
    best = 0
    fail = False
    while p0 < N:
        if fail:
            p0 += 1
            # p2????±???????
            while d(p2, p1) > d(p1, p0) and p2 > p1:
                p2 -= 1
            fail = False
        # p1????±???????
        if p1 <= p0: p1 = p0 + 1
        while d(p1, p0) <= best and p1 - p0 < N:
            p1 += 1
        if d(p1, p0) <= best:
            fail = True
            continue
        # p2????±???????
        if p2 <= p1: p2 = p1 + 1
        while d(p2,p1) < d(p1, p0) and p2 - p0 < N:
            p2 += 1
        if d(p2, p1) < d(p1, p0):
            fail = True
            continue
        # check
        if L - d(p2, p0) >= d(p1, p0):
            best = d(p1, p0)
            if best >= L//3:
                return best
        else:
            fail = True
    return best

N = int(input())
A = [0] * N
L = 0
for i in range(N):
    A[i] = int(input())
    L += A[i]
pos = [0] * (2*N)
for i in range(1, 2*N):
    pos[i] = pos[i-1] + A[(i-1)%N]

print(solve())

Fixed submission:
def solve():
    p0, p1, p2 = 0, 1, 2
    best = 1
    succ = True
    while p0 < N-1:
        if not succ:
            p0 += 1
            while d[p2]- d[p1] > d[p1]- d[p0]:
                p2 -= 1

        succ = False

        while p1 - p0 < N - 1 and d[p1] - d[p0] <= best:
            p1 += 1
        d0 = d[p1] - d[p0]
        if d0 <= best:
            continue

        while p2 - p0 < N and d[p2] - d[p1] < d0:
            p2 += 1
        if d[p2] - d[p1] < d0:
            continue

        if L - (d[p2] - d[p0]) >= d0:
            best = d0
            if best >= L//3:
                return best
            succ = True

    return best

N = int(input())
A = [int(input()) for i in range(N)]
L = sum(A)
d = [0] * (2 * N)
for i in range(1, 2 * N):
    d[i] = d[i-1] + A[(i-1)%N]

print(solve())
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int, input().split()))
q = int(input())
M = list(map(int, input().split()))
def rec(i, m):
    if m == 0:
        return True
    if i >= n:
        return False
    res = rec(i + 1, m) | rec(i + 1, m - A[i])
    return res
for m in M:
    if rec(0, m):
        print('yes')
    else:
        print('no')


Fixed submission:
n = int(input())
A = list(map(int, input().split()))
q = int(input())
M = list(map(int, input().split()))
bits = 1
for a in A:
    bits |= bits << a
for m in M:
    print('yes' if (bits >> m) & 1 else 'no')

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int, input().split()))
q = int(input())
M = list(map(int, input().split()))
def rec(i, m):
    if m == 0:
        return True
    if i >= n:
        return False
    res = rec(i + 1, m)
    if m - A[i] >= 0:
        res |= rec(i + 1, m - A[i])
    return res
for m in M:
    if rec(0, m):
        print('yes')
    else:
        print('no')


Fixed submission:
n = int(input())
A = list(map(int, input().split()))
q = int(input())
M = list(map(int, input().split()))
bits = 1
for a in A:
    bits |= bits << a
for m in M:
    print('yes' if (bits >> m) & 1 else 'no')
Buggy python submission (verdict: Time Limit Exceeded):
cnt = 0
def merge(A, left, mid, right):
    global cnt
    n1 = mid - left
    n2 = right - mid
    L, R = list(range(n1 + 1)), list(range(n2 + 1))
    for i in range(n1):
        L[i] = A[left + i]
    for i in range(n2):
        R[i] = A[mid + i]
    L[n1] = 10 ** 10
    R[n2] = 10 ** 10
    i = 0
    j = 0
    for k in range(left, right):
        cnt += 1
        if L[i] <= R[j]:
            A[k] = L[i]
            i = i + 1
        else:
            A[k] = R[j]
            j = j + 1
def merge_sort(A, left, right):
    if left + 1 < right:  # 1 < right - left
        mid = (left + right) // 2
        merge_sort(A, left, mid)
        merge_sort(A, mid, right)
        merge(A, left, mid, right)
    return A

n = int(input())
A = list(map(int, input().split()))
print(*merge_sort(A, 0, n))
print(cnt)


Fixed submission:
cnt = 0
def merge(A, left, mid, right):
    global cnt
    L = A[left:mid] + [10 ** 10]
    R = A[mid:right] + [10 ** 10]
    i = j = 0
    for k in range(left, right):
        cnt += 1
        if L[i] <= R[j]:
            A[k] = L[i]
            i += 1
        else:
            A[k] = R[j]
            j += 1
def merge_sort(A, left, right):
    if left + 1 < right:  # 1 < right - left
        mid = (left + right) // 2
        merge_sort(A, left, mid)
        merge_sort(A, mid, right)
        merge(A, left, mid, right)
    return A

n = int(input())
A = list(map(int, input().split()))
print(*merge_sort(A, 0, n))
print(cnt)
Buggy python submission (verdict: Time Limit Exceeded):
from bisect import bisect_right
def inv_number(A):
    cnt = 0
    left = []
    for i, a in enumerate(A):
        j = bisect_right(left, a)
        cnt += i - j
        left.insert(j, a)
    return cnt
n = int(input())
print(inv_number(list(map(int, input().split()))))


Fixed submission:
n = int(input())
A = [(i + 1, int(j)) for i, j in enumerate(input().split())]
A.sort(key=lambda x: -x[1])

class BIT:
    def __init__(self, n):
        self.data = [0] * (n + 1)
    def add(self, i, x):
        while i <= n:
            self.data[i] += x
            # 区間の長さ
            i += i & -i

    def get(self, i):
        s = 0
        while i:
            s += self.data[i]
            i -= i & -i
        return s

b = BIT(n)
ans = 0
for i, j in A:
    ans += b.get(i)
    b.add(i, 1)
print(ans)
Buggy python submission (verdict: Runtime Error):
li=[]
while(a!=0):
    a=int(input())
    li.append(a)
for i in range(1,len(li)+1):
    if li[i]!=0:
        print("case　{0}: {1}".format(i,li[i]))
    else:
        break


Fixed submission:
li=[]
a=1
while(a!=0):
    a=int(input())
    li.append(a)
for i in range(1,len(li)+1):
    if li[i-1]!=0:
        print("Case {0}: {1}".format(i,li[i-1]))
    else:
        break
Buggy python submission (verdict: Runtime Error):
def get_n():
    return int(input())
def get_ns():
    return [int(a) for a in input().split()]
import math
def main():
    n = get_n()
    ns = sorted(set([get_n() for _ in range(n)]))
    top3 = [9999999999,9999999999,9999999999]
    for i,a in enumerate(ns):
        for j,b in enumerate(ns):
            if i==j:
                continue
            keta = int(math.log10(b))+1
            c = a*pow(10,keta)+b
            if c <top3[2]:
                top3 = sorted(top3+[c])[:-1]
    print(top3[2])





if __name__ == '__main__':
    main()



Fixed submission:
def get_n():
    return int(input())
def get_ns():
    return [int(a) for a in input().split()]
import math
def main():
    n = get_n()
    ns = sorted(set([get_n() for _ in range(n)]))[:100]
    top3 = [9999999999,9999999999,9999999999]
    for i,a in enumerate(ns):
        for j,b in enumerate(ns):
            if i==j:
                continue
            keta = int(math.log10(b))+1
            c = a*pow(10,keta)+b
            if c <top3[2]:
                top3 = sorted(top3+[c])[:-1]
    print(top3[2])





if __name__ == '__main__':
    main()