Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
l,r = map(int,input().split())
x = []
if r-l>2019:
  print(0)
else:
  for i in range(l,r):
    for j in range(i+1,r+1):
      res = (i*j)%2019
      x.append(res)
   print(min(x))

Fixed submission:
l,r = map(int,input().split())
x = []
if r-l>2019:
  print(0)
else:
  for i in range(l,r):
    for j in range(i+1,r+1):
      res = (i*j)%2019
      x.append(res)
  print(min(x))

Buggy python submission (verdict: Runtime Error):
l,r = map(int,input().split())
x = []
if r-l>2019:
  print(0)
else:
  for i in range(l,r):
    for j in range(i+1,r+1):
      res = (i*j)%2019
      x.append(res)
print(min(x))

Fixed submission:
l,r = map(int,input().split())
x = []
if r-l>2019:
  print(0)
else:
  for i in range(l,r):
    for j in range(i+1,r+1):
      res = (i*j)%2019
      x.append(res)
  print(min(x))

Buggy python submission (verdict: Time Limit Exceeded):
l,r = map(int,input().split())
x = []
for i in range(l,r):
  for j in range(i+1,r+1):
    res = (i*j)%2019
    x.append(res)
print(min(x))

Fixed submission:
l,r = map(int,input().split())
x = []
if r-l>2019:
  print(0)
else:
  for i in range(l,r):
    for j in range(i+1,r+1):
      res = (i*j)%2019
      x.append(res)
  print(min(x))

Buggy python submission (verdict: Runtime Error):
l,r = map(int,input().split())
x = []
for i in range(l,r-1):
  for j in range(i+1,r):
    res = (i*j)%2019
    x.append(res)
print(min(x))

Fixed submission:
l,r = map(int,input().split())
x = []
if r-l>2019:
  print(0)
else:
  for i in range(l,r):
    for j in range(i+1,r+1):
      res = (i*j)%2019
      x.append(res)
  print(min(x))

Buggy python submission (verdict: Runtime Error):
l,r = map(int,input().split())
x = []
for i in range(l,r-1):
  for j in range(i+1,r):
    res = (i*j)%2019
    x.append(res)
xs = sorted(x)
print(x[1])

Fixed submission:
l,r = map(int,input().split())
x = []
if r-l>2019:
  print(0)
else:
  for i in range(l,r):
    for j in range(i+1,r+1):
      res = (i*j)%2019
      x.append(res)
  print(min(x))

Buggy python submission (verdict: Runtime Error):
l,r = map(int,input().split())
x = []
for i in range(l,r-1):
  for j in range(i+1,r):
    res = (i*j)%2019
    x.append(res)
xs = sorted(x)
print(x[1])

Fixed submission:
l,r = map(int,input().split())
x = []
if r-l>2019:
  print(0)
else:
  for i in range(l,r):
    for j in range(i+1,r+1):
      res = (i*j)%2019
      x.append(res)
  print(min(x))
Buggy python submission (verdict: Runtime Error):
n = int(input())
d = sorted(list(map(int,input().split())))
print(d)
print(d[0])
print(d[n//2 + 2])
print(d[n//2 + 1])
if d[n//2 + 1] == d[n//2 +2]:
    print("0")
else:
    print(d[n//2] - d[n//2 -1])

Fixed submission:
n = int(input())
d = sorted(list(map(int,input().split())))
if d[n//2 ] == d[n//2 -1]:
    print("0")
else:
    print(d[n//2] - d[n//2 -1])
Buggy python submission (verdict: Runtime Error):
s = input()
for i in range(len(s)):
  if s[i] == s[i+1]:
    print("Bad")
  else:
    print("Good")

Fixed submission:
s = input()
res = "Good"
for i in range(3):
  if s[i] == s[i+1]:
    res = "Bad"
print(res)
Buggy python submission (verdict: Runtime Error):
r,d,x = map(int,input().split())
ansl =[x]
for i in range(10):
  ans = r*ansl[i] - d
  print(ans)

Fixed submission:
r,d,x = map(int,input().split())
ansl =[x]
for i in range(10):
  ans = r*ansl[i] - d
  print(ans)
  ansl.append(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
a = [k for k in range(1,10**5+1)]
s = set(a)
for i in range(m):
  l,r = map(int,input().split())
  ml = [p for p in range(l,r+1)]
  newset = set(ml)
  s = s&newset
print(len(s))

Fixed submission:
n,m = map(int,input().split())
L = []
R = []
for i in range(m):
  l,r = map(int,input().split())
  L.append(l)
  R.append(r)

ans = min(R)-max(L)+1
print(ans if ans >0 else "0")

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
a = [k for k in range(1,10**5+1)]
s = set(a)
for i in range(m):
  l,r = map(int,input().split())
  ml = []
  for j in range(l,r+1):
    ml.append(j)
  newset = set(ml)
  s = s&newset
print(len(s))

Fixed submission:
n,m = map(int,input().split())
L = []
R = []
for i in range(m):
  l,r = map(int,input().split())
  L.append(l)
  R.append(r)

ans = min(R)-max(L)+1
print(ans if ans >0 else "0")

Buggy python submission (verdict: Time Limit Exceeded):
n,m = map(int,input().split())
a = [k for k in range(1,10**5+1)]
s = set(a)
for i in range(m):
  l,r = map(int,input().split())
  ml = []
  for j in range(l,r+1):
    ml.append(j)
  newset = set(ml)
  s = s&newset
print(len(s))

Fixed submission:
n,m = map(int,input().split())
L = []
R = []
for i in range(m):
  l,r = map(int,input().split())
  L.append(l)
  R.append(r)

ans = min(R)-max(L)+1
print(ans if ans >0 else "0")

Buggy python submission (verdict: Runtime Error):
n,m = map(int,input().split())
s = {}
for i in range(m):
  l,r = map(int,input().split())
  for j in range(l,r+1):
    l = []
    l.append(i)
    newset = set(l)
  s = s&newset
print(len(s))
    

Fixed submission:
n,m = map(int,input().split())
L = []
R = []
for i in range(m):
  l,r = map(int,input().split())
  L.append(l)
  R.append(r)

ans = min(R)-max(L)+1
print(ans if ans >0 else "0")
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().splt())
s = list(input())
s[k-1] = s[k-1].lower()
s ="".join(s)
print(s)

Fixed submission:
n,k = map(int,input().split())
s = list(input())
s[k-1] = s[k-1].lower()
s ="".join(s)
print(s)

Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
s = input()
s[k-1] = s[k-1].lower()
print(s)

Fixed submission:
n,k = map(int,input().split())
s = list(input())
s[k-1] = s[k-1].lower()
s ="".join(s)
print(s)
Buggy python submission (verdict: Runtime Error):
a,b = int(input())
if a>b:
  print(2*a-1)
elif a<b:
  print(2*b-1)
else:
  print(2*a)

Fixed submission:
a,b = map(int,input().split())
if a>b:
  print(2*a-1)
elif a<b:
  print(2*b-1)
else:
  print(2*a)
Buggy python submission (verdict: Runtime Error):
b = input()
if b = "A":
  print("T")
elif b = "T":
  print("A")
elif b = "C":
  print("G")
else:
  print("C")

Fixed submission:
b = input()
if b == "A":
  print("T")
elif b == "T":
  print("A")
elif b == "C":
  print("G")
else:
  print("C")
Buggy python submission (verdict: Runtime Error):
s = input()
cnt = 0
cnt_list = []
for i in range(len(s)):
  if s[i] == "A":
    cnt +=1
  elif s[i] == "C":
    cnt +=1
  elif s[i] == "G":
    cnt +=1
  elif s[i] == "T":
    cnt +=1
  else:
    cnt_list.append(cnt)
    cnt = 0
print(max(cnt_list))

Fixed submission:
s = input()
acgt = ["A","C","G","T"]
cnt = 0
cnt_list = []
for i in range(len(s)):
    if s[i] in acgt:
        cnt +=1
        if s[-1] in acgt:
            cnt_list.append(cnt)
    else:
        cnt_list.append(cnt)
        cnt = 0
print(max(cnt_list))

Buggy python submission (verdict: Runtime Error):
s = input()
cnt = 0
cnt_list = []
for i in range(len(s)):
  if s[i] == "A" or "C" or "G" or "T":
    cnt +=1
  else:
    cnt_list.append(cnt)
  cnt = 0
print(max(cnt_list))
    

Fixed submission:
s = input()
acgt = ["A","C","G","T"]
cnt = 0
cnt_list = []
for i in range(len(s)):
    if s[i] in acgt:
        cnt +=1
        if s[-1] in acgt:
            cnt_list.append(cnt)
    else:
        cnt_list.append(cnt)
        cnt = 0
print(max(cnt_list))
Buggy python submission (verdict: Runtime Error):
n,m,c = map(int,input().split())
b = map(int,input().split())
cnt = 0
sum = 0
for i in range(n):
  a = map(int,input().split())
  for j in range(m):
    sum += (a[j]*b[j])
  sum += c
  if sum > 0:
    cnt += 1
  else:
    pass
print(cnt)

Fixed submission:
n,m,c = map(int,input().split())
b = list(map(int,input().split()))
cnt = 0
for i in range(n):
  a = list(map(int,input().split()))
  sum = 0
  for j in range(m):
    sum += (a[j]*b[j])
  sum += c
  if sum > 0:
    cnt += 1
  else:
    pass
print(cnt)

Buggy python submission (verdict: Runtime Error):
n,m,c = map(int,input().split())
b = map(int,input()split())
cnt = 0
sum = 0
for i in range(n):
  a = map(int,input().split())
  for j in range(m):
    sum += (a[j]*b[j])
    sum += c
  if sum > 0:
    cnt += 1
  else:
    pass
print(cnt)

Fixed submission:
n,m,c = map(int,input().split())
b = list(map(int,input().split()))
cnt = 0
for i in range(n):
  a = list(map(int,input().split()))
  sum = 0
  for j in range(m):
    sum += (a[j]*b[j])
  sum += c
  if sum > 0:
    cnt += 1
  else:
    pass
print(cnt)
Buggy python submission (verdict: Runtime Error):
n,m = map(int,input.split())
S = set(range(1,m+1))
for i in range(n):
  a,*b = map(int,input().split())
  S &= set(b)
print(len(S))
  

Fixed submission:
n,m = map(int,input().split())
S = set(range(1,m+1))
for i in range(n):
  a,*b = map(int,input().split())
  S &= set(b)
print(len(S))
Buggy python submission (verdict: Runtime Error):
n = int(input())
L = [list(map(int,input().split()))]
if max(L)<sum(L)-max(L):
  print("Yes")
else:
  print("No")

Fixed submission:
n = int(input())
L = list(map(int,input().split()))
if max(L)<sum(L)-max(L):
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
s = input()
for i in range(3):
  if s[i] =="1":
    s[i] = "9"
  else:
    s[i] = "1"
print(s)

Fixed submission:
s = input()
s =s.replace("1","a").replace("9","1").replace("a","9")
print(s)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
if "2" in a or "2" in b:
  print("No")
else:
  print("Yes")

Fixed submission:
a,b = input().split()
if "2" in a or "2" in b:
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Runtime Error):
s = sorted(map(int,input().splitu()))
v = s[2] - s[0]
print(v)

Fixed submission:
s = sorted(map(int,input().split()))
v = s[2] - s[0]
print(v)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
if a=>b:
  print(a)
else:
  print(a-1)

Fixed submission:
a,b = map(int,input().split())
if a>b:
  print(a-1)
else:
  print(a)
Buggy python submission (verdict: Runtime Error):
h,w = map(int,input())
L = [input() for i in range(h)]
ans = "ahe"
if L[0][0]=="#" and (L[0][1]=="." and L[1][0]=="."):
    ans="No"
elif L[0][w]=="#" and (L[0][w-1]=="." and L[1][w]=="."):
    ans="No"
elif L[h][0]=="#" and (L[h][1]=="." and L[h-1][0]=="."):
    ans="No"
elif L[h][w]=="#" and (L[h][w-1]=="." and L[h-1][w]=="."):
    ans="No"
for i in range(1,w):
    if L[0][i]=="#" and (L[0][i+1]=="." and L[1][i] =="." and L[1][i-1]):
        ans="No"
for i in range(1,w):
    if L[h][i]=="#" and (L[h][i+1]=="." and L[h-1][i] =="." and L[h][i-1]):
        ans="No"
for i in range(1,h):
    if L[i][0]=="#" and (L[i][1]=="." and L[i+1][0]=="." and L[i-1][0]=="."):
        ans="No"
for i in range(1,h):
    if L[i][w]=="#" and (L[i][w-1]=="." and L[i+1][w]=="." and L[i-1][w]==".")
for i in range(1,h):
    for j in range(1,w):
        if L[i][j]=="#" and (L[i+1][j]=="." and L[i-1][j]=="." and L[i][j+1]=="." and L[i][j-1]=="."):
            ans="No"
if ans !="No":
    ans ="Yes"
print(ans)

Fixed submission:
h,w = map(int,input().split())
L =["b"*(w+2)] + ["b"+ input() + "b" for i in range(h)] + ["b"*(w+2)]
ans = "ahe"
for i in range(1,h+1):
    for j in range(1,w+1):
        if L[i][j]=="#" and (L[i+1][j]!="#" and L[i-1][j]!="#" and L[i][j+1]!="#" and L[i][j-1]!="#"):
            ans="No"
if ans!="No":
    ans="Yes"
print(ans)
Buggy python submission (verdict: Runtime Error):
n,x,m = map(int,input().split())
a = list(map(int,input().split()))
lcnt = 0
rcnt = 0
for i in range(m):
  if a[i] < x:
    lcnt += 1
  else:
    rcnt += 1
print(min(lcnt,rcnt))
    

Fixed submission:
n,m,x = map(int,input().split())
a = list(map(int,input().split()))
lcnt = 0
rcnt = 0
for i in range(m):
  if a[i] < x:
    lcnt += 1
  else:
    rcnt += 1
print(min(lcnt,rcnt))
Buggy python submission (verdict: Runtime Error):
s = str(input())
a = {a,b,c}
if set(s) == a:
  print("Yes")
else:
  print("No")

Fixed submission:
s = str(input())
a = {"a","b","c"}
if set(s) == a:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
nm = int(input())
n = [input() for _ in range(nm)]
mm = int(input())
m = [input() for _ in range(mm)]
s = list(set(n))

print(max(0,max(n.count(s[i])-m.count(s[i]) for i in range(len(s))))

Fixed submission:
nm = int(input())
n = [input() for _ in range(nm)]
mm = int(input())
m = [input() for _ in range(mm)]
s = list(set(n))

print(max(0,max(n.count(s[i])-m.count(s[i]) for i in range(len(s)))))
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
cnt = 0
for i in range(a,b+1):
  if str(i)[0]==str(i)[-1] and str(i)[1] = str(i)[-2]:
    cnt +=1
print(cnt)

Fixed submission:
a,b = map(int,input().split())
cnt = 0
for i in range(a,b+1):
  if str(i)[0]==str(i)[-1] and str(i)[1] == str(i)[-2]:
    cnt +=1
print(cnt)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
n  = int(str(a)+str(b)
m = n**(1/2)
if int(m**2) ==n:
  print("Yes")
else:
  print("No")

Fixed submission:
a,b = input().split()
s = a+b
print("Yes" if int((int(s)**(1/2)))**2 == int((int(s)**(1/2))**2) else "No")

Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
n  = int(str(a)+str(b)
m = n**(1/2)
if m**2 ==n:
  print("Yes")
else:
  print("No")

Fixed submission:
a,b = input().split()
s = a+b
print("Yes" if int((int(s)**(1/2)))**2 == int((int(s)**(1/2))**2) else "No")
Buggy python submission (verdict: Runtime Error):
s = input()
s.replace("2017","2018)

Fixed submission:
s = input()
s = s.replace("2017","2018")
print(s)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
s = input()
L = [i for i in range(1,10)]
ans = "Yes"
for i in range(a):
  if  not int(s[i]) in L:
    ans = "No"
if s[a] != "-":
  ans = "No"
for i in range(a+1,a+b+1):
    if  not int(s[i]) in L:
    ans = "No"
print(ans)

Fixed submission:
a,b = map(int,input().split())
s = input()
L = [i for i in range(10)]
ans = "Yes"
for i in range(a):
  if s[i]=="-" or not int(s[i]) in L:
    ans = "No"
if s[a] != "-":
  ans = "No"
for i in range(a+1,a+b+1):
    if s[i]=="-" or not int(s[i]) in L:
      ans = "No"
print(ans)
Buggy python submission (verdict: Runtime Error):
s = input()
print(s.ccount("1"))

Fixed submission:
s = input()
print(s.count("1"))
Buggy python submission (verdict: Runtime Error):
n = int(input())
A = list(map(int,input().split()))
ans = 0
for i in range(n):
  cnt = 0
  if A[i]%2:
    break
  else:
    A[i] = A[i]/2
    cnt +=1
  if cnt ==n
  ans +=1
print(ans)
    
  

Fixed submission:
n = int(input())
A = list(map(int,input().split()))
ans = 0
cnt = 0
for j in range(31):
  cnt = 0
  for i in range(n):  
    if A[i]%2:
      break
    else:
      A[i] = A[i]/2
      cnt +=1
    if cnt ==n:
      ans +=1
print(ans)
Buggy python submission (verdict: Runtime Error):
n = input()
wa = 0
for i in range(len(n)):
  wa += int(n[i])
if n%wa:
  print("No")
else:
  print("Yes")

Fixed submission:
n = input()
wa = 0
for i in range(len(n)):
  wa += int(n[i])
if int(n)%wa:
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
def Lucas(i):
    if i == 0:
        return 2
    if i == 1:
        return 1
    return Lucas(i-1) + Lucas(i-2)
print(Lucas(n))

Fixed submission:
n = int(input())
L0 = 2
L1 = 1
for i in range(n):
    L0,L1 = L1,L0+L1
print(L0)
Buggy python submission (verdict: Runtime Error):
x,y,z = map(int,input().split())
print((x-2)//(Y+Z))

Fixed submission:
x,y,z = map(int,input().split())
print((x-z)//(y+z))
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = int(input())
print(N**2 - a)

Fixed submission:
n = int(input())
a = int(input())
print(n**2 - a)
Buggy python submission (verdict: Runtime Error):
n = input()
sum = 0
for i in range(n):
  l,r = map(int,input().split())
  sum += r - l + 1
print(sum)
  

Fixed submission:
n = int(input())
sum = 0
for i in range(n):
  l,r = map(int,input().split())
  sum += r - l + 1
print(sum)
Buggy python submission (verdict: Runtime Error):
a,b,c,d = map(int,input().split())
if a<=c:
  if b-c>0
    print(b-c)
  else:
    print(0)
else:
  if d-a>0:
    print(d-a)
  else:
    print(0)

Fixed submission:
a,b,c,d = map(int,input().split())
if a<=c:
  if b-c>0:
    print(min(b-c,d-c))
  else:
    print(0)
else:
  if d-a>0:
    print(min(d-a,b-a))
  else:
    print(0)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
orint("Possible" if a%3==0 or b%3==0 or (a+b)%3==0 else "Impossible")

Fixed submission:
a,b = map(int,input().split())
print("Possible" if a%3==0 or b%3==0 or (a+b)%3==0 else "Impossible")
Buggy python submission (verdict: Runtime Error):
o = str(input())
e = str(input())
x = []
if len(o) == len(e):
  for i in range(len(o)):
    x.append(o[i]+e[i])
else:
  for i in range(len(e)):
    x.append(o[i]+e[i])
  x.append(a[-1])
print(*x,sep="")
    

Fixed submission:
o = str(input())
e = str(input())
x = []
if len(o) == len(e):
  for i in range(len(o)):
    x.append(o[i]+e[i])
else:
  for i in range(len(e)):
    x.append(o[i]+e[i])
  x.append(o[-1])
print(*x,sep="")

Buggy python submission (verdict: Runtime Error):
o = input()
e = input()
x = []
if len(o) == len(e):
  for i in range(len(o)):
    x.append(o[i]+e[i])
else:
  for i in range(len(e)):
    x.append(o[i]+e[i])
  x.append(a[-1])
print(*x,sep="")
    

Fixed submission:
o = str(input())
e = str(input())
x = []
if len(o) == len(e):
  for i in range(len(o)):
    x.append(o[i]+e[i])
else:
  for i in range(len(e)):
    x.append(o[i]+e[i])
  x.append(o[-1])
print(*x,sep="")

Buggy python submission (verdict: Runtime Error):
o = input()
e = input()
x = []
if len(o) == len(e):
  for i in range(len(o)):
    x.append(o[i]+e[1])
else:
  for i in range(len(e)):
    x.append(o[i]+e[i])
  x.append(a[-1])
print(*x,sep="")
    

Fixed submission:
o = str(input())
e = str(input())
x = []
if len(o) == len(e):
  for i in range(len(o)):
    x.append(o[i]+e[i])
else:
  for i in range(len(e)):
    x.append(o[i]+e[i])
  x.append(o[-1])
print(*x,sep="")

Buggy python submission (verdict: Runtime Error):
o = input()
e = input()
x = []
if len(o) == len(e):
  for i in range(len(o)):
    x.append(o[i]+e[1])
else len(o) != len(e):
  for i in range(len(e)):
    x.append(o[i]+e[i])
  x.append(a[-1])
print(*x,sep="")
    

Fixed submission:
o = str(input())
e = str(input())
x = []
if len(o) == len(e):
  for i in range(len(o)):
    x.append(o[i]+e[i])
else:
  for i in range(len(e)):
    x.append(o[i]+e[i])
  x.append(o[-1])
print(*x,sep="")

Buggy python submission (verdict: Runtime Error):
o = input()
e = input()
x = []
if len(o) = len(e):
  for i in range(len(o)):
    x.append(o[i]+e[1])
else len(o) != len(e):
  for i in range(len(e)):
    x.append(o[i]+e[i])
  x.append(a[-1])
print(*x,sep="")
    

Fixed submission:
o = str(input())
e = str(input())
x = []
if len(o) == len(e):
  for i in range(len(o)):
    x.append(o[i]+e[i])
else:
  for i in range(len(e)):
    x.append(o[i]+e[i])
  x.append(o[-1])
print(*x,sep="")
Buggy python submission (verdict: Runtime Error):
a,b = input(),split()
if a=="H" and b=="H":
  print("H")
elif a=="H" and b=="D":
  print("D")
elif a=="D" and b=="H":
  print("D")
else:
  print("H")

Fixed submission:
a,b = input().split()
if a=="H" and b=="H":
  print("H")
elif a=="H" and b=="D":
  print("D")
elif a=="D" and b=="H":
  print("D")
else:
  print("H")
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
print("Alice" if (a>b and b!=1) or (a==1 and b!=1) else "Bob" (if a<b and a!=1) or(a!=1 and b==1) else "Draw")

Fixed submission:
a,b = map(int,input().split())
print("Alice" if (a>b and b!=1) or (a==1 and b!=1) else "Bob" if (a<b and a!=1) or(a!=1 and b==1) else "Draw")
Buggy python submission (verdict: Runtime Error):
n = input()
k = input()
x = input()
y = input()
print(k*x + (n-k)*y)

Fixed submission:
n = int(input())
k = int(input())
x = int(input())
y = int(input())
if n >= k:
  print(k*x + (n-k)*y)
else:
  print(n*x)
Buggy python submission (verdict: Runtime Error):
n,l = map(int,input().split())
mylist=sotrted([input() for i in range(n)])
print("".join(mylist))

Fixed submission:
n,l = map(int,input().split())
mylist=sorted([input() for i in range(n)])
print("".join(mylist))
Buggy python submission (verdict: Runtime Error):
import sys
# gcd
from fractions import gcd
# 切り上げ，切り捨て
# from math import ceil, floor
# リストの真のコピー（変更が伝播しない）
# from copy import deepcopy
# 累積和。list(accumulate(A))としてAの累積和
from itertools import accumulate
# l = ['a', 'b', 'b', 'c', 'b', 'a', 'c', 'c', 'b', 'c', 'b', 'a']
# S = Counter(l)  # カウンタークラスが作られる。S=Counter({'b': 5, 'c': 4, 'a': 3})
# print(S.most_common(2))  # [('b', 5), ('c', 4)]
# print(S.keys())  # dict_keys(['a', 'b', 'c'])
# print(S.values())  # dict_values([3, 5, 4])
# print(S.items())  # dict_items([('a', 3), ('b', 5), ('c', 4)])
# from collections import Counter
# import math
# from functools import reduce
#
# input関係の定義
import os
fin = open('in_2.txt', 'r')
sys.stdin = fin
input = sys.stdin.readline
def ii(): return int(input())
def mi(): return map(int, input().rstrip().split())
def lmi(): return list(map(int, input().rstrip().split()))
def li(): return list(input().rstrip())
# template


def iterate_tokens():
    for line in sys.stdin:
        for word in line.split():
            yield word


if __name__ == '__main__':

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    S = next(tokens)  # type: str

    # write code
    A = list(S)
    A[K-1] = A[K-1].lower()
    print(''.join(A))


Fixed submission:
import sys
# gcd
from fractions import gcd
# 切り上げ，切り捨て
# from math import ceil, floor
# リストの真のコピー（変更が伝播しない）
# from copy import deepcopy
# 累積和。list(accumulate(A))としてAの累積和
from itertools import accumulate
# l = ['a', 'b', 'b', 'c', 'b', 'a', 'c', 'c', 'b', 'c', 'b', 'a']
# S = Counter(l)  # カウンタークラスが作られる。S=Counter({'b': 5, 'c': 4, 'a': 3})
# print(S.most_common(2))  # [('b', 5), ('c', 4)]
# print(S.keys())  # dict_keys(['a', 'b', 'c'])
# print(S.values())  # dict_values([3, 5, 4])
# print(S.items())  # dict_items([('a', 3), ('b', 5), ('c', 4)])
# from collections import Counter
# import math
# from functools import reduce
#
# input関係の定義
# import os
# fin = open('in_2.txt', 'r')
# sys.stdin = fin
input = sys.stdin.readline
def ii(): return int(input())
def mi(): return map(int, input().rstrip().split())
def lmi(): return list(map(int, input().rstrip().split()))
def li(): return list(input().rstrip())
# template


def iterate_tokens():
    for line in sys.stdin:
        for word in line.split():
            yield word


if __name__ == '__main__':

    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    K = int(next(tokens))  # type: int
    S = next(tokens)  # type: str

    # write code
    A = list(S)
    A[K-1] = A[K-1].lower()
    print(''.join(A))