Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
'''
import sys
sys.setrecursionlimit(1000000)
def kaijo(n):
    if n==0:
        return(1)
    else:
        n=n%(10**9+7)
        return(n*kaijo(n-1))
print(kaijo(n)%(10**9+7))
'''
ans=1
for i in range(1,n+1):
    ans*=i%(10**9+7)
print(ans%(10**9+7))

Fixed submission:
n=int(input())
'''
import sys
sys.setrecursionlimit(1000000)
def kaijo(n):
    if n==0:
        return(1)
    else:
        n=n%(10**9+7)
        return(n*kaijo(n-1))
print(kaijo(n)%(10**9+7))
'''
ans=1
for i in range(1,n+1):
    ans=i*(ans%(10**9+7))
print(ans%(10**9+7))

Buggy python submission (verdict: Runtime Error):
n=int(input())
'''
import sys
sys.setrecursionlimit(1000000)
def kaijo(n):
    if n==0:
        return(1)
    else:
        n=n%(10**9+7)
        return(n*kaijo(n-1))
print(kaijo(n)%(10**9+7))
'''
ans=1
for i in range(1,n+1):
    ans*=i%(10**)+7
print(ans%(10**9+7))

Fixed submission:
n=int(input())
'''
import sys
sys.setrecursionlimit(1000000)
def kaijo(n):
    if n==0:
        return(1)
    else:
        n=n%(10**9+7)
        return(n*kaijo(n-1))
print(kaijo(n)%(10**9+7))
'''
ans=1
for i in range(1,n+1):
    ans=i*(ans%(10**9+7))
print(ans%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
import sys
sys.setrecursionlimit(1000000)
def kaijo(n):
    if n==0:
        return(1)
    else:
        n=n%(10**9+7)
        return(n*kaijo(n-1))
print(kaijo(n)%(10**9+7))


Fixed submission:
n=int(input())
'''
import sys
sys.setrecursionlimit(1000000)
def kaijo(n):
    if n==0:
        return(1)
    else:
        n=n%(10**9+7)
        return(n*kaijo(n-1))
print(kaijo(n)%(10**9+7))
'''
ans=1
for i in range(1,n+1):
    ans=i*(ans%(10**9+7))
print(ans%(10**9+7))

Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
import sys
sys.setrecursionlimit(1000000)
def kaijo(n):
    if n==0:
        return(1)
    else:
        return(n*kaijo(n-1))
print(kaijo(n)%(10**9+7))


Fixed submission:
n=int(input())
'''
import sys
sys.setrecursionlimit(1000000)
def kaijo(n):
    if n==0:
        return(1)
    else:
        n=n%(10**9+7)
        return(n*kaijo(n-1))
print(kaijo(n)%(10**9+7))
'''
ans=1
for i in range(1,n+1):
    ans=i*(ans%(10**9+7))
print(ans%(10**9+7))

Buggy python submission (verdict: Runtime Error):
n=int(input())
def kaijo(n):
    if n==0:
        return(1)
    else:
        return(n*kaijo(n-1))
print(kaijo(n)%(10**9+7))


Fixed submission:
n=int(input())
'''
import sys
sys.setrecursionlimit(1000000)
def kaijo(n):
    if n==0:
        return(1)
    else:
        n=n%(10**9+7)
        return(n*kaijo(n-1))
print(kaijo(n)%(10**9+7))
'''
ans=1
for i in range(1,n+1):
    ans=i*(ans%(10**9+7))
print(ans%(10**9+7))
Buggy python submission (verdict: Time Limit Exceeded):
import math
n=int(input())
klist=[]
MOD=10**9+7
ans=1
n=math.factorial(n)
for i in range(2,n+1):
    kaisu=0
    while n%i==0:
        n=n//i
        kaisu+=1
    if kaisu!=0:
        klist.append(kaisu%MOD)
for i in range(len(klist)):
    ans*=((klist[i]+1)%MOD)
ans=ans%MOD
print(ans)

Fixed submission:
n=int(input())
klist=[]
MOD=10**9+7
ans=1
kaijo=list(range(n+1))
for i in range(2,n+1):
    kaisu=0
    for j in range(1,n+1):
        while kaijo[j]%i==0:
            kaijo[j]=kaijo[j]//i
            kaisu+=1
    if kaisu!=0:
        klist.append(kaisu%MOD)
for i in range(len(klist)):
    ans*=((klist[i]+1)%MOD)
ans=ans%MOD
print(ans)
Buggy python submission (verdict: Runtime Error):
[k,s]=list(map(int,input().split()))
counter=0
imax=min(s+1,k+1)
jmax=min(s-i+1,k+1)
for i in range(imax):
	for j in range(0,jmax):
		if i<=k and j<=k and s-i-j<=k:
			counter+=1
print(counter)

Fixed submission:
[k,s]=list(map(int,input().split()))
counter=0
imax=min(s+1,k+1)
for i in range(imax):
	jmax=min(s-i+1,k+1)
	for j in range(0,jmax):
		if i<=k and j<=k and s-i-j<=k:
			counter+=1
print(counter)

Buggy python submission (verdict: Time Limit Exceeded):
[k,s]=list(map(int,input().split()))
counter=0
for i in range(s+1):
	for j in range(0,s-i+1):
		if i<=k and j<=k and s-i-j<=k:
			counter+=1
print(counter)

Fixed submission:
[k,s]=list(map(int,input().split()))
counter=0
imax=min(s+1,k+1)
for i in range(imax):
	jmax=min(s-i+1,k+1)
	for j in range(0,jmax):
		if i<=k and j<=k and s-i-j<=k:
			counter+=1
print(counter)

Buggy python submission (verdict: Time Limit Exceeded):
[k,s]=list(map(int,input().split()))
counter=0
for i in range(s+1):
	for j in range(0,s-i+1):
		if i<=k and j<=k and s-i-j<=k:
			counter+=1
print(counter)

Fixed submission:
[k,s]=list(map(int,input().split()))
counter=0
imax=min(s+1,k+1)
for i in range(imax):
	jmax=min(s-i+1,k+1)
	for j in range(0,jmax):
		if i<=k and j<=k and s-i-j<=k:
			counter+=1
print(counter)
Buggy python submission (verdict: Runtime Error):
[sx, sy, tx, ty]=list(map(int,input().split()))
a1=["R"]*(tx-sx)+["U"]*(ty-sy)+["L"]*(tx-sx)+["D"]*(ty-sy)
a2=["D"]+["R"]*(tx-sx+1)+["U"]*(ty-sy+1)+["L"]+["U"]+["L"]*(tx-sx+1)+["D"]*(ty-sy+1)+["R"]
ans=a1+a2
for i in range(len(ans))
	print(ans[i],end=" ")




Fixed submission:
[sx, sy, tx, ty]=list(map(int,input().split()))
a1=["R"]*(tx-sx)+["U"]*(ty-sy)+["L"]*(tx-sx)+["D"]*(ty-sy)
a2=["D"]+["R"]*(tx-sx+1)+["U"]*(ty-sy+1)+["L"]+["U"]+["L"]*(tx-sx+1)+["D"]*(ty-sy+1)+["R"]
ans=a1+a2
for i in range(len(ans)):
	print(ans[i],end="")
Buggy python submission (verdict: Runtime Error):
[a,op,b]=list(input().split())
siki=a+op+b
	print(eval(siki))

Fixed submission:
[a,op,b]=list(input().split())
siki=a+op+b
print(eval(siki))
Buggy python submission (verdict: Runtime Error):
n=int(input())
t=list(map(int,input().split()))
m=int(input())
juice=[]
for i in range(m):
	juice.append(list(map(int,input().split())))

for i in range(m):
	ans=0
	for j in range(n):
		if j==juice[i][0]-1
			ans+=juice[i][1]
		else:
			ans+=t[j]
	print(ans)

Fixed submission:
n=int(input())
t=list(map(int,input().split()))
m=int(input())
juice=[]
for i in range(m):
	juice.append(list(map(int,input().split())))

for i in range(m):
	ans=0
	for j in range(n):
		if j==juice[i][0]-1:
			ans+=juice[i][1]
		else:
			ans+=t[j]
	print(ans)
Buggy python submission (verdict: Runtime Error):
c=input()
boin=[a,e,i,o,u]
if c in boin:
	print("vowel")
else:
	print("consonant")

Fixed submission:
c=input()
boin=["a","e","i","o","u"]
if c in boin:
	print("vowel")
else:
	print("consonant")
Buggy python submission (verdict: Runtime Error):
import copy
[n,x]=list(map(int,input().split()))
a=list(map(int,input().split()))
a0=copy.copy(a)
ans=0
for i in range(n-1):
	while a[i]+a[i+1]>x:
		a[i+1]-=1
for i in range(n):
	ans+=a0[i]-a[i]
print(ans)

Fixed submission:
name=input().split()
b=list(name[1])
print("A"+b[0]+"C")
Buggy python submission (verdict: Runtime Error):
import copy
[n,x]=list(map(int,input().split()))
a=list(map(int,input().split()))
a0=copy.copy(a)
ans=0
if a[0]+a[1]>x and a[0]>x:
	a[0]-=a[0]-x
	ans+=a0[0]-x
		if a[0]+a[1]>x:
			a[1]=0
			ans+=a[1]
	
for i in range(1,n-1):
	if a[i]+a[i+1]>x:
		a[i+1]-=a[i]+a[i+1]-x
		ans+=a[i]+a[i+1]-x
print(ans)

Fixed submission:
import copy
[n,x]=list(map(int,input().split()))
a=list(map(int,input().split()))
a0=copy.copy(a)
ans=0
if a[0]+a[1]>x and a[0]>x:
	ans+=a[0]-x
	a[0]-=a[0]-x
	if a[0]+a[1]>x:
		ans+=a[1]
		a[1]=0	
for i in range(n-1):
	if a[i]+a[i+1]>x:
		ans+=a[i]+a[i+1]-x
		a[i+1]-=a[i]+a[i+1]-x
		
print(ans)

Buggy python submission (verdict: Runtime Error):
import copy
[n,x]=list(map(int,input().split()))
a=list(map(int,input().split()))
a0=copy.copy(a)
ans=0
if a[0]+a[1]>x and a[0]>x:
	a[0]-=a[0]-x
	ans+=a[0]-x
		if a[0]+a[1]>x:
			a[1]=0
			ans+=a[1]
	
for i in range(1,n-1):
	if a[i]+a[i+1]>x:
		a[i+1]-=a[i]+a[i+1]-x
		ans+=a[i]+a[i+1]-x
print(ans)

Fixed submission:
import copy
[n,x]=list(map(int,input().split()))
a=list(map(int,input().split()))
a0=copy.copy(a)
ans=0
if a[0]+a[1]>x and a[0]>x:
	ans+=a[0]-x
	a[0]-=a[0]-x
	if a[0]+a[1]>x:
		ans+=a[1]
		a[1]=0	
for i in range(n-1):
	if a[i]+a[i+1]>x:
		ans+=a[i]+a[i+1]-x
		a[i+1]-=a[i]+a[i+1]-x
		
print(ans)

Buggy python submission (verdict: Runtime Error):
import copy
[n,x]=list(map(int,input().split()))
a=list(map(int,input().split()))
a0=copy.copy(a)
ans=0
if a[0]+a[1]>x and a[0]>x:
	a[0]-=a[0]-x
	and+=a[0]-x
		if a[0]+a[1]>x:
			a[1]=0
			ans+=a[1]
	
for i in range(1,n-1):
	if a[i]+a[i+1]>x:
		a[i+1]-=a[i]+a[i+1]-x
		ans+=a[i]+a[i+1]-x
print(ans)

Fixed submission:
import copy
[n,x]=list(map(int,input().split()))
a=list(map(int,input().split()))
a0=copy.copy(a)
ans=0
if a[0]+a[1]>x and a[0]>x:
	ans+=a[0]-x
	a[0]-=a[0]-x
	if a[0]+a[1]>x:
		ans+=a[1]
		a[1]=0	
for i in range(n-1):
	if a[i]+a[i+1]>x:
		ans+=a[i]+a[i+1]-x
		a[i+1]-=a[i]+a[i+1]-x
		
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import copy
[n,x]=list(map(int,input().split()))
a=list(map(int,input().split()))
a0=copy.copy(a)
ans=0
for i in range(n-1):
	while a[i]+a[i+1]>x:
		a[i+1]-=1
		ans+=1
print(ans)

Fixed submission:
import copy
[n,x]=list(map(int,input().split()))
a=list(map(int,input().split()))
a0=copy.copy(a)
ans=0
if a[0]+a[1]>x and a[0]>x:
	ans+=a[0]-x
	a[0]-=a[0]-x
	if a[0]+a[1]>x:
		ans+=a[1]
		a[1]=0	
for i in range(n-1):
	if a[i]+a[i+1]>x:
		ans+=a[i]+a[i+1]-x
		a[i+1]-=a[i]+a[i+1]-x
		
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
import copy
[n,x]=list(map(int,input().split()))
a=list(map(int,input().split()))
a0=copy.copy(a)
ans=0
for i in range(n-1):
	while a[i]+a[i+1]>x:
		a[i+1]-=1
for i in range(n):
	ans+=a0[i]-a[i]
print(ans)

Fixed submission:
import copy
[n,x]=list(map(int,input().split()))
a=list(map(int,input().split()))
a0=copy.copy(a)
ans=0
if a[0]+a[1]>x and a[0]>x:
	ans+=a[0]-x
	a[0]-=a[0]-x
	if a[0]+a[1]>x:
		ans+=a[1]
		a[1]=0	
for i in range(n-1):
	if a[i]+a[i+1]>x:
		ans+=a[i]+a[i+1]-x
		a[i+1]-=a[i]+a[i+1]-x
		
print(ans)
Buggy python submission (verdict: Runtime Error):
[w,h,n]=list(map(int,input().split()))
risuto=[]
xmin=0
xmax=w
ymin=0
ymax=h
for i in range n:
	risuto.append(list(map(int,input().split())))
for i in range n:
	if risuto[i][2]==1 and risuto[i][0]>xmin:
		xmin=risuto[i][0]
	elif risuto[i][2]==2 and risuto[i][0]<xmax:
		xmax=risuto[i][0]
	elif risuto[i][2]==3 and risuto[i][1]>ymin:
		ymin=risuto[i][1]
	elif risuto[i][2]==4 and risuto[i][1]<ymax:
		ymax=risuto[i][1]
menseki=int((xmax-xmin)*(ymax-ymin))
print(menseki)


Fixed submission:
[w,h,n]=list(map(int,input().split()))
risuto=[]
xmin=0
xmax=w
ymin=0
ymax=h
for i in range(n):
	risuto.append(list(map(int,input().split())))
for i in range(n):
	if risuto[i][2]==1 and risuto[i][0]>xmin:
		xmin=risuto[i][0]
	elif risuto[i][2]==2 and risuto[i][0]<xmax:
		xmax=risuto[i][0]
	elif risuto[i][2]==3 and risuto[i][1]>ymin:
		ymin=risuto[i][1]
	elif risuto[i][2]==4 and risuto[i][1]<ymax:
		ymax=risuto[i][1]
menseki=int((xmax-xmin)*(ymax-ymin))
if xmax<=xmin or ymax<=ymin:
	menseki=0
if menseki<0:
	menseki=0
print(menseki)
Buggy python submission (verdict: Time Limit Exceeded):
[n,t]=list(map(int,input().split()))
alist=list(map(int,input().split()))
salist=[alist[1]-alist[0]]
for i in range(1,n-1):
	saisho=min(alist[0:i])
	salist.append(alist[i+1]-saisho)
saidai=max(salist)
kaisu=salist.count(saidai)
print(kaisu)

Fixed submission:
[n,t]=list(map(int,input().split()))
alist=list(map(int,input().split()))
salist=[alist[1]-alist[0]]
saisho=min(alist[0],alist[1])
for i in range(1,n-1):
	saisho=min(saisho,alist[i])
	salist.append(alist[i+1]-saisho)
saidai=max(salist)
kaisu=salist.count(saidai)
print(kaisu)

Buggy python submission (verdict: Runtime Error):
[n,t]=list(map(int,input().split()))
alist=list(map(int,input().split()))

"""
alist.reverse()
n=n-1
dp=[[0 for j in range(n)]for k in range(n)]
for i in range(n-1):
	dp[i][i+1]=alist[i+1]-alist[i]
	
for i in reversed(range(0,n-1)):
	for j in range(n-1-i):
		dp[i][i+2+j]=dp[i][i+1]+dp[i+1][i+2+j]

maximum=max(dp[0])
for i in range(1,n):
	if maximum<max(dp[i]):
		maximum=max(dp[i])
kosu=0
for i in range(0,n):
	kosu=kosu+dp[i].count(maximum)
print(kosu)
"""

salist=[]
for i in range(n-1):
	saisho=min(alist[0:i])
	salist.append(alist[i+1]-saisho)
saidai=max(salist)
kaisu=salist.count(saidai)
print(kaisu)

Fixed submission:
[n,t]=list(map(int,input().split()))
alist=list(map(int,input().split()))
salist=[alist[1]-alist[0]]
saisho=min(alist[0],alist[1])
for i in range(1,n-1):
	saisho=min(saisho,alist[i])
	salist.append(alist[i+1]-saisho)
saidai=max(salist)
kaisu=salist.count(saidai)
print(kaisu)

Buggy python submission (verdict: Runtime Error):
[n,t]=list(map(int,input().split()))
alist=list(map(int,input().split()))
alist.reverse()
n=n-1
dp=[[0 for j in range(n)]for k in range(n)]
for i in range(n-1):
	dp[i][i+1]=alist[i+1]-alist[i]
	
for i in reversed(range(0,n-1)):
	for j in range(n-1-i):
		dp[i][i+2+j]=dp[i][i+1]+dp[i+1][i+2+j]

maximum=max(dp[0])
for i in range(1,n):
	if maximum<max(dp[i]):
		maximum=max(dp[i])
kosu=0
for i in range(0,n):
	kosu=kosu+dp[i].count(maximum)
print(kosu)

Fixed submission:
[n,t]=list(map(int,input().split()))
alist=list(map(int,input().split()))
salist=[alist[1]-alist[0]]
saisho=min(alist[0],alist[1])
for i in range(1,n-1):
	saisho=min(saisho,alist[i])
	salist.append(alist[i+1]-saisho)
saidai=max(salist)
kaisu=salist.count(saidai)
print(kaisu)
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
suji=[]
for i in range (n):
	suji=suji+list(map(int,input().split()))
tlist=[]
alist=[]
for i in range(2*n):
	if i%2==0:
		tlist.append(suji[i])
	else:
		alist.append(suji[i])

for i in range(n-1):
	k=1
	while tlist[i]>tlist[i+1]*k or alist[i]>alist[i+1]*k:
		k+=1
	tlist[i+1]=tlist[i+1]*k
	alist[i+1]=alist[i+1]*k

print(int(tlist[n-1]+alist[n-1]))

Fixed submission:
n=int(input())
suji=[]
for i in range (n):
	suji=suji+list(map(int,input().split()))
tlist=[]
alist=[]
for i in range(2*n):
	if i%2==0:
		tlist.append(suji[i])
	else:
		alist.append(suji[i])

for i in range(n-1):
	aaa=alist[i]//alist[i+1]
	ttt=tlist[i]//tlist[i+1]
	if alist[i]%alist[i+1]!=0:
		aaa+=1
	if tlist[i]%tlist[i+1]!=0:
		ttt+=1
	k=max(aaa,ttt)
	tlist[i+1]=tlist[i+1]*k
	alist[i+1]=alist[i+1]*k

print(int(tlist[n-1]+alist[n-1]))
Buggy python submission (verdict: Runtime Error):
s=list(input())
n=len(s)
for i in range(2**(n-1)):
	ni=list(map(int,list(str(format(i,"b")))))
	while len(ni)<n-1:
		ni.insert(0,0)
	siki=s[0]
	for j in range(n-1):
		if ni[j]==1:
			siki+="+"
		siki+=s[j+1]
	ans+=eval(siki)
print(ans)

	

Fixed submission:
s=list(input())
n=len(s)
ans=0
for i in range(2**(n-1)):
	ni=list(map(int,list(str(format(i,"b")))))
	while len(ni)<n-1:
		ni.insert(0,0)
	siki=s[0]
	for j in range(n-1):
		if ni[j]==1:
			siki+="+"
		siki+=s[j+1]
	ans+=eval(siki)
print(ans)
Buggy python submission (verdict: Runtime Error):
n=int(input())
k=int(input())
x=int(input())
y=inr(input())
if n>k:
	kane=k*x+(n-k)*y
else:
	kane=k*x
print(kane)

Fixed submission:
n=int(input())
k=int(input())
x=int(input())
y=int(input())
if n>k:
	kane=k*x+(n-k)*y
else:
	kane=n*x
print(kane)
Buggy python submission (verdict: Runtime Error):
w=input()
alphabet=[a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z]
flag=0
for i in alphabet:
	num=w.count(i)
	if num%2==1:
		flag=1
		break
if flag==0:
	print("Yes")
else:
	print("No")

Fixed submission:
w=input()
alphabet=["a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"]
flag=0
for i in alphabet:
	num=w.count(i)
	if num%2==1:
		flag=1
		break
if flag==0:
	print("Yes")
else:
	print("No")
Buggy python submission (verdict: Runtime Error):
list=input().split()
l=len(list)
output=""
for i in l:
	if list[i]=="0" or "1":
		output=output+list[i]
	else:
		if i!=0:
			output=output-list[i-1]
print(output)

Fixed submission:
nyu=input()
shutu=[]
for i in nyu:
	if i=="B":
		if len(shutu)!=0:
			shutu.pop(-1)
	else:
		shutu.append(i)
kekka="".join(shutu)
print(kekka)
Buggy python submission (verdict: Runtime Error):
(n,l)=map(int, input().split())
list1=input().split()
list1.sort()
for i in range(n):
	print(list1[i],end="")

Fixed submission:
(n,l)=map(int, input().split())
list1=[]
for i in range(n):
	list1.extend(input().split())
list1.sort()
for i in range(n):
	print(list1[i],end="")

Buggy python submission (verdict: Runtime Error):
(n,l)=map(int, input().split())
list1=list(input().split())
list1.sort()
for i in range(n):
	print(list1[i],end="")

Fixed submission:
(n,l)=map(int, input().split())
list1=[]
for i in range(n):
	list1.extend(input().split())
list1.sort()
for i in range(n):
	print(list1[i],end="")

Buggy python submission (verdict: Runtime Error):
(n,l)=map(int, input().split())
list1=list(input().split())
list1.sort()
for i in range(n):
	print(list1[i],end="")

Fixed submission:
(n,l)=map(int, input().split())
list1=[]
for i in range(n):
	list1.extend(input().split())
list1.sort()
for i in range(n):
	print(list1[i],end="")

Buggy python submission (verdict: Runtime Error):
(n,l)=input().split()
list1=list(input().split())
list1.sort()
for i in range(n)
	print(list1[i]+"")

Fixed submission:
(n,l)=map(int, input().split())
list1=[]
for i in range(n):
	list1.extend(input().split())
list1.sort()
for i in range(n):
	print(list1[i],end="")
Buggy python submission (verdict: Runtime Error):
n,k=[s for s in input().split()]
hate=[]
like=[]
for i in range(k): #hate取得
	hate.extend(input().split())
for i in range(1,10): #like取得
	if i in hate:
		like.append(i)
pointer=0
		
for ichi in like: #1桁の場合
	if ichi>=n:
		kane=ichi
		pointer=1
		break

if pointer==0: #2桁の場合
	for ju in like:
		for ichi in like:
			if ju*10+ichi>=n:
				kane=ju*10+ichi
				pointer=1
				break

if pointer==0: #3桁の場合
	for hyaku in like:
		for ju in like:
			for ichi in like:
				if hyaku*100+ju*10+ichi>=n:
					kane=hyaku*100+ju*10+ichi
					pointer=1
					break

if pointer==0: #4桁の場合
	for sen in like:
		for hyaku in like:
			for ju in like:
				for ichi in like:
					if sen*1000+hyaku*100+ju*10+ichi>=n:
						kane=sen*1000+hyaku*100+ju*10+ichi
						pointer=1
						break

if pointer==1:
	print(kane)
else:
	print("Error!!")

Fixed submission:
n,k=[s for s in input().split()]
n=int(n)
k=int(k)
hate=list(map(int, input().split())) #hate取得
like=[]
hate.sort()
like.sort()
for i in range(10): #like取得
	if i not in hate:
		like.append(i)
pointer=0
		
for ichi in like: #1桁の場合
	if ichi>=n:
		kane=ichi
		pointer=1
		break

if pointer==0: #2桁の場合
	for ju in like:
		for ichi in like:
			if ju*10+ichi>=n:
				kane=ju*10+ichi
				pointer=1
				break
		if pointer==1:
			break


if pointer==0: #3桁の場合
	for hyaku in like:
		for ju in like:
			for ichi in like:
				if hyaku*100+ju*10+ichi>=n:
					kane=hyaku*100+ju*10+ichi
					pointer=1
					break
			if pointer==1:
				break
		if pointer==1:
			break

if pointer==0: #4桁の場合
	for sen in like:
		for hyaku in like:
			for ju in like:
				for ichi in like:
					if sen*1000+hyaku*100+ju*10+ichi>=n:
						kane=sen*1000+hyaku*100+ju*10+ichi
						pointer=1
						break
				if pointer==1:
					break
			if pointer==1:
				break
		if pointer==1:
			break

if pointer==0: #5桁の場合
	for man in like:
		for sen in like:
			for hyaku in like:
				for ju in like:
					for ichi in like:
						if man*10000+sen*1000+hyaku*100+ju*10+ichi>=n:
							kane=man*10000+sen*1000+hyaku*100+ju*10+ichi
							pointer=1
							break
					if pointer==1:
						break
				if pointer==1:
					break
			if pointer==1:
				break
		if pointer==1:
			break				

if pointer==1:
	print(kane)
else:
	print("Error!!")
Buggy python submission (verdict: Runtime Error):
import math
import os
import random
import re
import sys
import collections
import itertools

def solution(data):
    return data[:3]


if __name__=="__main__":
  	a = input()

    print(solution(a))


Fixed submission:
import math
import os
import random
import re
import sys
import collections
import itertools

def solution(data):
    return data[:3]


if __name__=="__main__":
    a = input()
    print(solution(a))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
P = list(map(int, input().split()))

ans = 0
for i, j in enumerate(P):
    if min(P[:i + 1]) >= j:
        ans += 1

print(ans)

Fixed submission:
N = int(input())
P = list(map(int, input().split()))

ans = 0
p_min = P[0]
for i, j in enumerate(P):
    if p_min >= j:
        ans += 1
        p_min = j

print(ans)
Buggy python submission (verdict: Runtime Error):
import math

N, X, T = input().split(' ')
print(math.ceil(N/X) * T)

Fixed submission:
import math

N, X, T = input().split(' ')
print(math.ceil(int(N)/int(X)) * int(T))
Buggy python submission (verdict: Runtime Error):
from sys import stdin
from collections import defaultdict

N, X = [int(x) for x in stdin.readline().rstrip().split()]
L = []
L = [int(x) for x in stdin.readline().rstrip().split()]

D = 0
i = 0
while(D<=X and i<N+1):
    i += 1
    D += L[i-1]

print(i)


Fixed submission:
#not accept

from sys import stdin
from collections import defaultdict

N, X = [int(x) for x in stdin.readline().rstrip().split()]
L = []
L = [int(x) for x in stdin.readline().rstrip().split()]

D = [0]
for i in range(1,N+1):
    D.append(D[i-1] + L[i-1])

max = 0
for i in range(1,N+1):
    if D[i] <= X:
      max = i
    else:
      break

print(max+1)
Buggy python submission (verdict: Runtime Error):
from sys import stdin

b = int(stdin.readline().rstrip()))

if b == 'A':
    print('T')
if b == 'T':
    print('A')
if b == 'G':
    print('C')
if b == 'C':
    print('G')


Fixed submission:
from sys import stdin

b = stdin.readline().rstrip()

if b == 'A':
    print('T')
if b == 'T':
    print('A')
if b == 'G':
    print('C')
if b == 'C':
    print('G')
Buggy python submission (verdict: Runtime Error):
import sys
import numpy as np
from operator import mul
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

d = int(readline())
c = list(map(int, readline().split()))
s = []
for _ in range(d):
    add = list(map(int, readline().split()))
    s.append(add)

#t = [0] * d
day = 0
satisfy = 0
sumC = sum(c)
count = np.zeros(26)

for i in range(d):
    t = int(readline()) - 1
    up = s[day][t]
    count += 1
    count[t] = 0
    sub = map(mul, count, c)
    satisfy += (up - sum(sub))

    # satisfy
    print(satisfy)


Fixed submission:
import sys
import numpy as np
from operator import mul
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

d = int(readline())
c = list(map(int, readline().split()))
s = []
for _ in range(d):
    add = list(map(int, readline().split()))
    s.append(add)

#t = [0] * d
day = 0
satisfy = 0
sumC = sum(c)
count = np.zeros(26)

for i in range(d):
    #t = int(readline()) - 1
    tarLis = s[day]
    tar = max(tarLis)
    t = tarLis.index(tar) + 1
    print(t)
    day += 1
    '''
    up = s[day][t]
    count += 1
    count[t] = 0
    sub = map(mul, count, c)
    satisfy += (up - sum(sub))

    # satisfy
    print(satisfy)
    '''

Buggy python submission (verdict: Runtime Error):
import sys
import numpy as np
from operator import mul
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

d = int(readline())
c = list(map(int, readline().split()))
s = []
for _ in range(d):
    add = list(map(int, readline().split()))
    s.append(add)

#t = [0] * d
day = 0
satisfy = 0
sumC = sum(c)
count = np.zeros(26)

for i in range(d):
    #t = int(readline()) - 1
    tarLis = s[day]
    tar = max(tarLis)
    t = tarLis.index(t) + 1
    print(t)
    day += 1
    '''
    up = s[day][t]
    count += 1
    count[t] = 0
    sub = map(mul, count, c)
    satisfy += (up - sum(sub))

    # satisfy
    print(satisfy)
    '''


Fixed submission:
import sys
import numpy as np
from operator import mul
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines

d = int(readline())
c = list(map(int, readline().split()))
s = []
for _ in range(d):
    add = list(map(int, readline().split()))
    s.append(add)

#t = [0] * d
day = 0
satisfy = 0
sumC = sum(c)
count = np.zeros(26)

for i in range(d):
    #t = int(readline()) - 1
    tarLis = s[day]
    tar = max(tarLis)
    t = tarLis.index(tar) + 1
    print(t)
    day += 1
    '''
    up = s[day][t]
    count += 1
    count[t] = 0
    sub = map(mul, count, c)
    satisfy += (up - sum(sub))

    # satisfy
    print(satisfy)
    '''