Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
N, L = map(int, input().split())
S = [input() for i in range(L)]
S.sort()
ans = ''
for i in range(N):
    ans += S[i]
print(ans)

Fixed submission:
n,l = map(int,input().split())
A = [input() for _ in range(n)]
A.sort()
ans = ''
for i in range(n):
    ans += A[i]
 
print(ans)

Buggy python submission (verdict: Runtime Error):
N, L = map(int, input().split())
S = [input() for i in range(L)]
S.sort()
ans = ""
for i in S:
    ans += i
print(ans)

Fixed submission:
n,l = map(int,input().split())
A = [input() for _ in range(n)]
A.sort()
ans = ''
for i in range(n):
    ans += A[i]
 
print(ans)

Buggy python submission (verdict: Runtime Error):
N, L = map(int, input().split())
S = [input() for i in range(L)]
S.sort()
print("".join(S))

Fixed submission:
n,l = map(int,input().split())
A = [input() for _ in range(n)]
A.sort()
ans = ''
for i in range(n):
    ans += A[i]
 
print(ans)

Buggy python submission (verdict: Runtime Error):
L, N = map(int, input().split())
S = [input() for i in range(N)]
S.sort()
ans = '';
for j in range(N):
    ans += S[j]
print(ans)


Fixed submission:
n,l = map(int,input().split())
A = [input() for _ in range(n)]
A.sort()
ans = ''
for i in range(n):
    ans += A[i]
 
print(ans)

Buggy python submission (verdict: Runtime Error):
L, N = list(map(int, input().split()))
S = []
for i in range(N):
    s = input()
    S.append(s)
S.sort()
ans = "";
for j in S:
    ans += j
print(str(ans))


Fixed submission:
n,l = map(int,input().split())
A = [input() for _ in range(n)]
A.sort()
ans = ''
for i in range(n):
    ans += A[i]
 
print(ans)

Buggy python submission (verdict: Runtime Error):
L, N = list(map(int, input().split()))
S = []
for i in range(N):
    s = input()
    S.append(s)
S.sort()
ans = "";
for j in S:
    ans += j
print(ans)


Fixed submission:
n,l = map(int,input().split())
A = [input() for _ in range(n)]
A.sort()
ans = ''
for i in range(n):
    ans += A[i]
 
print(ans)
Buggy python submission (verdict: Runtime Error):
code = str(input())
if code[0]==code[1] or code[1]==code[2] or code[2]==code[3]:
  print("Bad")
else:
  print("Good")

Fixed submission:
s = raw_input()
if s[0] == s[1] or s[1] == s[2] or s[2] == s[3]:
  print('Bad')
else:
  print('Good')

Buggy python submission (verdict: Runtime Error):
code = len(set(list(str(input()))))
if code==4:
  print("Good")
else:
  print("Bad")

Fixed submission:
s = raw_input()
if s[0] == s[1] or s[1] == s[2] or s[2] == s[3]:
  print('Bad')
else:
  print('Good')
Buggy python submission (verdict: Runtime Error):
from sys import stdin
n = int(stdin.readline().rstrip())
h = [int(x) for x in stdin.readline().rstrip().split()]
ans = 1
tmp = h[0]
for i in range(n - 1):
    ans += 1 if tmp <= h[i + 1] else 0
    tmp = max(tmp, h[i + 1])
print("{}".format(ans))

Fixed submission:
# -*- coding: utf-8 -*-
from sys import stdin
a, b = [int(x) for x in stdin.readline().rstrip().split()]
res = 0
if a > b:
    res += a
    a -= 1
else:
    res += b
    b -= 1
res += a if a > b else b
print("{}".format(res))
Buggy python submission (verdict: Runtime Error):
n = int(input())
w = list(map(int,input().split()))
ans = 1000000000
for t in range(1, n):
    left = sum(w[:t])
    right = sum(w[t:])
    ans = min(ans , abs(left - right))
print(ans)
        

Fixed submission:
P,Q,R =map(int,input().split())
print(P+Q+R-max(P,Q,R))

Buggy python submission (verdict: Runtime Error):
n = int(input())
w = list(map(int,input(),split()))
ans = 1000000000
for t in range(1, n):
    left = sum(w[:t])
    right = sum(w[t:])
    ans = min(ans , abs(left - right))
print(ans)
        

Fixed submission:
P,Q,R =map(int,input().split())
print(P+Q+R-max(P,Q,R))
Buggy python submission (verdict: Runtime Error):
n = int(input())
w = list(map(int,input(),split()))
ans = 1000000000
for t in range(1, n);
    left = sum(w[:t])
    right = sum(w[t:])
    ans = min(ans , abs(left - right))
print(ans)
        

Fixed submission:
n = int(input())
w = list(map(int,input().split()))
ans = 1000000000
for t in range(1, n):
    left = sum(w[:t])
    right = sum(w[t:])
    ans = min(ans , abs(left - right))
print(ans)
Buggy python submission (verdict: Runtime Error):
A,P = map(int,input(),split())
print((A*3+P)//2)

Fixed submission:
A,P = map(int,input().split())
print((A * 3+ P) // 2)
Buggy python submission (verdict: Runtime Error):
a,b = map(int,input().split())
    if a >=13:
        print(b)
    elif a <= 5:
        print(0)
    else:
        print(b // 2)

Fixed submission:
a,b = map(int,input().split())
if a >=13:
    print(b)
elif a <= 5:
        print(0)
else:
    print(b // 2)
Buggy python submission (verdict: Runtime Error):
r,d,x = map(int,input().split())
for i in range(10)
    x = r * x - d
    print(x)

Fixed submission:
r,d,x = map(int,input().split())
for i in range(10):
    x = r * x - d
    print(x)
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
s = input()
print(s[:k -1] + s[k -1].lower + s[k:-1])

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

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 = input()
print(s[:k -1] + s[k -1].lower() + s[k:])

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 = input()
print(s[:k -1] + s[k -1].lower() + s[k:])

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 = input()
print(s[:k -1] + s[k -1].lower() + s[k:])
Buggy python submission (verdict: Runtime Error):
a=int(input())
b=int(input())

if a>8 or b>8 or a<0 or b<0:
  print(":(")
else:
  print("Yay!")

Fixed submission:
a,b=map(int,input().split())

if a>8 or b>8 or a<0 or b<0:
  print(":(")
else:
  print("Yay!")

Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())

if A>8 or B>8 or A<0 or B<0:
  print(":(")
else:
  print("Yay!")

Fixed submission:
a,b=map(int,input().split())

if a>8 or b>8 or a<0 or b<0:
  print(":(")
else:
  print("Yay!")

Buggy python submission (verdict: Runtime Error):
A=int(input())
B=int(input())

if A>8 or B>8:
  print(":(")
else:
  print("Yay!")

Fixed submission:
a,b=map(int,input().split())

if a>8 or b>8 or a<0 or b<0:
  print(":(")
else:
  print("Yay!")
Buggy python submission (verdict: Time Limit Exceeded):
def main():
  N, Q = [int(x) for x in input().split()]
  S = input()
  counts = []
  for i in range(1, len(S) + 1):
    counts.append(S[:i].count('AC'))
  for i in range(Q):
    l, r = [int(x) for x in input().split()]
    print(counts[r - 1] - counts[l - 1])


if __name__ == "__main__":
  main()


Fixed submission:
def main():
  N, Q = map(int, input().split())
  S = input()
  counts = [0] * (N + 1)
  for i in range(0, len(S)):
    counts[i + 1] = counts[i] + (1 if S[i:i + 2] == 'AC' else 0)
  for i in range(Q):
    l, r = map(int, input().split())
    print(counts[r - 1] - counts[l - 1])


if __name__ == "__main__":
  main()

Buggy python submission (verdict: Time Limit Exceeded):

def main():
  N, Q = [int(x) for x in input().split()]
  S = input()
  for i in range(Q):
    l, r = [int(x) for x in input().split()]
    sub = S[l - 1:r]
    print(sub.count('AC'))


if __name__ == "__main__":
  main()


Fixed submission:
def main():
  N, Q = map(int, input().split())
  S = input()
  counts = [0] * (N + 1)
  for i in range(0, len(S)):
    counts[i + 1] = counts[i] + (1 if S[i:i + 2] == 'AC' else 0)
  for i in range(Q):
    l, r = map(int, input().split())
    print(counts[r - 1] - counts[l - 1])


if __name__ == "__main__":
  main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
  S = input()
  n = len(S)

  while True:
    tmp = S
    S = S.replace('01', '')
    S = S.replace('10', '')
    if tmp == S:
      break

  print(n - len(S))


if __name__ == "__main__":
  main()


Fixed submission:
def main():
  S = input()
  print(min(S.count('0'), S.count('1')) * 2)


if __name__ == "__main__":
  main()
Buggy python submission (verdict: Time Limit Exceeded):
def main():
  A, B, K = [int(x) for x in input().split()]
  l = [str(i) for i in range(A, B + 1) if i < A + K or i > B - K]
  print('\n'.join(l))


if __name__ == "__main__":
  main()


Fixed submission:
def main():
  A, B, K = [int(x) for x in input().split()]
  for i in range(A, min(B + 1, A + K)):
    print(i)
  for i in range(max(A + K, B - K + 1), B + 1):
    print(i)


if __name__ == "__main__":
  main()

Buggy python submission (verdict: Runtime Error):
A, B, N = [int(x) for x in input().split()]
array = list(range(A, B+1))

array = list(filter(lambda x: B-(N-1) <= x or x <= A+(N-1), array))

print('\n'.join([str(x) for x in array]))


Fixed submission:
def main():
  A, B, K = [int(x) for x in input().split()]
  for i in range(A, min(B + 1, A + K)):
    print(i)
  for i in range(max(A + K, B - K + 1), B + 1):
    print(i)


if __name__ == "__main__":
  main()
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
pos = [0] + [int(i) for i in input().split()] + [0]

for l in range(n):
    cost = 0
    tmp = pos.copy()
    tmp.pop(l+1)
    for i in range(n):
        cost += abs(tmp[i+1] - tmp[i])
    print(cost)

Fixed submission:
n = int(input())
pos = [0] + [int(i) for i in input().split()] + [0]

s = 0
for i in range(n+1):
    s += abs(pos[i+1] - pos[i])

for i in range(1, n+1):
    cost = s + abs(pos[i+1] - pos[i-1]) - abs(pos[i] - pos[i-1]) - abs(pos[i+1] - pos[i])
    print(cost)
Buggy python submission (verdict: Runtime Error):
    n = int(input())
     
    M = 0
    A = 0
    R = 0
    C = 0
    H = 0
     
    res = 0
     
    for i in range(n):
        char = input()[0]
        if char == "M":
            M += 1
        elif char == "A":
            A += 1
        elif char == "R":
            R += 1
        elif char == "C":
            C += 1
        elif char == "H":
            H += 1
     
    res += M * A * R;
    res += M * A * C;
    res += M * A * H;
    res += M * R * C;
    res += M * R * H;
    res += M * C * H;
     
    res += A * R * C;
    res += A * R * H;
    res += A * C * H;
     
    res += R * C * H;
     
    print(res)

Fixed submission:
n = int(input())
 
M = 0
A = 0
R = 0
C = 0
H = 0
 
res = 0
 
for i in range(n):
    char = input()[0]
    if char == "M":
        M += 1
    elif char == "A":
        A += 1
    elif char == "R":
        R += 1
    elif char == "C":
        C += 1
    elif char == "H":
        H += 1

res += M * A * R;
res += M * A * C;
res += M * A * H;
res += M * R * C;
res += M * R * H;
res += M * C * H;
 
res += A * R * C;
res += A * R * H;
res += A * C * H;
 
res += R * C * H;
 
print(res)
Buggy python submission (verdict: Runtime Error):
N, X = map(int, input().split())
steps = list(int,input().split())
 
x = 0
count = 1

for i in steps:
    x += i
    if x <= X:
        count += 1
 
print(count)

Fixed submission:
N, X = map(int, input().split())
steps = list(map(int,input().split()))
 
x = 0
count = 1

for i in steps:
    x += i
    if x <= X:
        count += 1
 
print(count)

Buggy python submission (verdict: Runtime Error):
N, X = map(int, input().split())
steps = list(input().split())
 
x = 0
count = 0
 
while x <= X and count <= N:
    x += int(steps[int(count)])
    count += 1
 
print(count)

Fixed submission:
N, X = map(int, input().split())
steps = list(map(int,input().split()))
 
x = 0
count = 1

for i in steps:
    x += i
    if x <= X:
        count += 1
 
print(count)

Buggy python submission (verdict: Runtime Error):
N, X = map(int, input().split())
steps = list(input().split())

x = 0
count = 0

while x < X:
    x += int(steps[int(count)])
    count +=1

print(count)

Fixed submission:
N, X = map(int, input().split())
steps = list(map(int,input().split()))
 
x = 0
count = 1

for i in steps:
    x += i
    if x <= X:
        count += 1
 
print(count)

Buggy python submission (verdict: Runtime Error):
N, X = map(int, input().split())
steps = list(input().split())

x = 0
count = 0

while x <= X:
    x += int(steps[int(count)])
    count +=1

print(count)

Fixed submission:
N, X = map(int, input().split())
steps = list(map(int,input().split()))
 
x = 0
count = 1

for i in steps:
    x += i
    if x <= X:
        count += 1
 
print(count)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
zahyou = list(map(int,input().split()))
zahyou.sort()
difference = []
ans = 0

if M == 1:
    ans = 0
else:
    for i in range (M-1):
        difference.append(zahyou[i+1] - zahyou[i])
    difference.append(0)
    difference.sort()
    difference.reverse()
    length = zahyou[-1] - zahyou[0]
    ans = int(length)
    for i in range (N-1):
        ans -= difference[i]

print(ans)

Fixed submission:
N, M = map(int, input().split())
zahyou = list(map(int,input().split()))
zahyou.sort()
difference = []
ans = 0

if N >= M:
    ans = 0
else:
    for i in range (M-1):
        difference.append(zahyou[i+1] - zahyou[i])
    difference.sort()
    ans = sum(difference[:M-N])

print(ans)

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
zahyou = list(map(int,input().split()))
zahyou.sort()
difference = []
ans = 0

if M == 1:
    ans = 0
else:
    for i in range (M-1):
        difference.append(zahyou[i+1] - zahyou[i])
    difference.append(0)
    difference.sort()
    difference.reverse()
    length = zahyou[-1] - zahyou[0]
    ans = int(length)
    for i in range (N):
        ans -= difference[i-1]

print(ans)

Fixed submission:
N, M = map(int, input().split())
zahyou = list(map(int,input().split()))
zahyou.sort()
difference = []
ans = 0

if N >= M:
    ans = 0
else:
    for i in range (M-1):
        difference.append(zahyou[i+1] - zahyou[i])
    difference.sort()
    ans = sum(difference[:M-N])

print(ans)
Buggy python submission (verdict: Runtime Error):
from collections import Counter
code = input()
cnt = 0
for i in range(len(code) - 1):
  if c[i] == c[i + 1]:
    cnt += 1
    break
if cnt:
  print("Bad")
else:
  print("Good")
  

Fixed submission:
from collections import Counter
code = input()
cnt = 0
for i in range(len(code) - 1):
  if code[i] == code[i + 1]:
    cnt += 1
    break
if cnt:
  print("Bad")
else:
  print("Good")

Buggy python submission (verdict: Runtime Error):
from collections import Counter
code = input()
max_c = Counter(list(code)).most_common()[0]
if max_c > 1:
  print("Bad")
else:
  print("Good")

Fixed submission:
from collections import Counter
code = input()
cnt = 0
for i in range(len(code) - 1):
  if code[i] == code[i + 1]:
    cnt += 1
    break
if cnt:
  print("Bad")
else:
  print("Good")
Buggy python submission (verdict: Runtime Error):
import sys
from collections import Counter

N = int(input())
points = []
for i, line in enumerate(sys.stdin):
    x, y = map(int, line.split())
    points.append([x, y])
    if i == N - 1:
        break

counts = []
for i in range(N):
    for j in range(N):
        if i == j:
            continue
        p = points[j][0] - points[i][0]
        q = points[j][1] - points[i][1]
        counts.append((p, q))

pq = Counter(counts).most_common()[0][1]
cost = N - pq
print(cost)


Fixed submission:
import sys
from collections import Counter

N = int(input())
points = []
for i, line in enumerate(sys.stdin):
    x, y = map(int, line.split())
    points.append([x, y])
    if i == N - 1:
        break
if len(points) == 1:
    print(1)
    sys.exit(0)

counts = []
for i in range(N):
    for j in range(N):
        if i == j:
            continue
        p = points[j][0] - points[i][0]
        q = points[j][1] - points[i][1]
        counts.append((p, q))

pq = Counter(counts).most_common()[0][1]
cost = N - pq
print(cost)

Buggy python submission (verdict: Runtime Error):
import sys
from collections import Counter

N = int(input())
points = []
for i, line in enumerate(sys.stdin):
    x, y = map(int, line.split())
    points.append([x, y])
    if i == N - 1:
        break

counts = []
for i in range(N - 1):
    p = points[i][0] - points[i+1][0]
    q = points[i][1] - points[i+1][1]
    counts.append((p, q))

pq = Counter(counts).most_common()[0][1]
cost = N - pq
print(cost)

Fixed submission:
import sys
from collections import Counter

N = int(input())
points = []
for i, line in enumerate(sys.stdin):
    x, y = map(int, line.split())
    points.append([x, y])
    if i == N - 1:
        break
if len(points) == 1:
    print(1)
    sys.exit(0)

counts = []
for i in range(N):
    for j in range(N):
        if i == j:
            continue
        p = points[j][0] - points[i][0]
        q = points[j][1] - points[i][1]
        counts.append((p, q))

pq = Counter(counts).most_common()[0][1]
cost = N - pq
print(cost)

Buggy python submission (verdict: Runtime Error):
import sys
from collections import Counter

N = int(input())
points = []
for i, line in enumerate(sys.stdin):
    x, y = map(int, input().split())
    points.append([x, y])
    if i == N:
        break

counts = []
for i in range(N - 1):
    p = points[i][0] - points[i+1][0]
    q = points[i][1] - points[i+1][1]
    counts.append((p, q))

pq = Counter(counts).most_common()[1]
cost = N - pq
print(cost)

Fixed submission:
import sys
from collections import Counter

N = int(input())
points = []
for i, line in enumerate(sys.stdin):
    x, y = map(int, line.split())
    points.append([x, y])
    if i == N - 1:
        break
if len(points) == 1:
    print(1)
    sys.exit(0)

counts = []
for i in range(N):
    for j in range(N):
        if i == j:
            continue
        p = points[j][0] - points[i][0]
        q = points[j][1] - points[i][1]
        counts.append((p, q))

pq = Counter(counts).most_common()[0][1]
cost = N - pq
print(cost)
Buggy python submission (verdict: Runtime Error):
import sys

if __name__ == '__main__':
    N, A = sys.argv[1:]
    assert 2<=int(N)<=200
    assert -100<=int(A)<=100

    L = int(A)
    R = int(A)+int(N)-1

    if R <= 0:
        eat = R
    elif L >= 0:
        eat = L
    else:
        eat = 0

    ans = (R+L)*(R-L+1)//2-eat
    print(ans)


Fixed submission:
if __name__ == '__main__':
    N, A = input().split()[0:]
    assert 2<=int(N)<=200
    assert -100<=int(A)<=100

    L = int(A)
    R = int(A)+int(N)-1

    if R <= 0:
        eat = R
    elif L >= 0:
        eat = L
    else:
        eat = 0

    ans = (R+L)*(R-L+1)//2-eat
    print(ans)
Buggy python submission (verdict: Runtime Error):
p,q,r = map(int, input().split())
print(min(p+q, q+r, r+s))

Fixed submission:
p,q,r = map(int, input().split())
print(min(p+q, q+r, r+p))
Buggy python submission (verdict: Runtime Error):
n = int(input())
data =[]
for i in range(n):
  sity, score = input().split()
  data.append([sity, int(score),i+1])
  
data.sort(key=lambda x:x[0], -x[1])
for j in range(n):
  print(data[j][2])
  

  

Fixed submission:
n = int(input())
data =[]
for i in range(n):
  sity, score = input().split()
  data.append([sity, int(score),i+1])
  
data.sort(key=lambda x:(x[0], -x[1]))
for j in range(n):
  print(data[j][2])
Buggy python submission (verdict: Runtime Error):
s = int(input())
k = int(input())
li = [int(k) for k in list(str(s))]
#print(li)
if k == 1:
  print(li[0])
else:
  print(li[1])

Fixed submission:
s = int(input())
k = int(input())
li = [int(k) for k in list(str(s))]
#print(li)
count = 0
for i in li:
  if i ==1:
    count+=1
  else:
    ans = i
    break
    
if k <= count:
  print(1)
else:
  print(ans)

Buggy python submission (verdict: Runtime Error):
s = int(input())
k = int(input())
li = [int(k) for k in list(str(s))]
#print(li)
if k = 1:
  print(li[0])
else:
  print(li[1])

Fixed submission:
s = int(input())
k = int(input())
li = [int(k) for k in list(str(s))]
#print(li)
count = 0
for i in li:
  if i ==1:
    count+=1
  else:
    ans = i
    break
    
if k <= count:
  print(1)
else:
  print(ans)
Buggy python submission (verdict: Runtime Error):
(X,Y,Z,K) = list(map(int,input().split()))
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

delicious_list = []
for a in A[:min((1000,len(A)))]:
    for b in B[:min((1000,len(B)))]:
        for c in C[:min((1000,len(C)))]:
            delicious_list.append(a+b+c)
delicious_list.sort(reverse=True)
for i in range(K):
    print(delicious_list[i])

Fixed submission:
lis = []
for i in range(5):
    lis.append(int(input()))
k = int(input())

flag_disconnectable = False
for i in range(5):
    for j in range(5):
        if i == j: continue
        if (lis[j]-lis[i]) > k:
            flag_disconnectable = True
            break

if flag_disconnectable:
    print(":(")
else:
    print("Yay!")

Buggy python submission (verdict: Runtime Error):
(X,Y,Z,K) = list(map(int,input().split()))
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

delicious_list = []
for a in A[:min((1100,len(A)))]:
    for b in B[:min((1100,len(B)))]:
        for c in C[:min((1100,len(C)))]:
            delicious_list.append(a+b+c)
delicious_list.sort(reverse=True)
for i in range(K):
    print(delicious_list[i])

Fixed submission:
lis = []
for i in range(5):
    lis.append(int(input()))
k = int(input())

flag_disconnectable = False
for i in range(5):
    for j in range(5):
        if i == j: continue
        if (lis[j]-lis[i]) > k:
            flag_disconnectable = True
            break

if flag_disconnectable:
    print(":(")
else:
    print("Yay!")

Buggy python submission (verdict: Runtime Error):
(X,Y,Z,K) = list(map(int,input().split()))
A = list(map(int,input().split()))
B = list(map(int,input().split()))
C = list(map(int,input().split()))
A.sort(reverse=True)
B.sort(reverse=True)
C.sort(reverse=True)

delicious_list = []
for a in A[:min((1500,len(A)))]:
    for b in B[:min((1500,len(A)))]:
        for c in C[:min((1500,len(A)))]:
            delicious_list.append(a+b+c)
delicious_list.sort(reverse=True)
for i in range(K):
    print(delicious_list[i])

Fixed submission:
lis = []
for i in range(5):
    lis.append(int(input()))
k = int(input())

flag_disconnectable = False
for i in range(5):
    for j in range(5):
        if i == j: continue
        if (lis[j]-lis[i]) > k:
            flag_disconnectable = True
            break

if flag_disconnectable:
    print(":(")
else:
    print("Yay!")
Buggy python submission (verdict: Runtime Error):
H,W = buf.split()
H = int(H)
W = int(W)
pic = []
 
for i in range(H):
    pic.append(input())
 
#for row in pic:
#    print(row)
 
for i in range(W+2):
    print("#",end="")
print()
 
for i in range(H):
    print("#"+pic[i]+"#")
 
for i in range(W+2):
    print("#",end="")

Fixed submission:
lis = [0,1,3,1,2,1,2,1,1,2,1,2,1]

x,y = (int(i) for i in input().split())

if lis[x] == lis[y] :
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
H,W = buf.split()
H = int(H)
W = int(W)
pic = []
 
for i in range(H):
    pic.append(input())
 
#for row in pic:
#    print(row)
 
for i in range(W+2):
    print("#",end="")
print()
 
for i in range(H):
    print("#"+pic[i]+"#")
 
for i in range(W+2):
    print("#",end="")

Fixed submission:
buf = input()
H,W = buf.split()
H = int(H)
W = int(W)
pic = []
 
for i in range(H):
    pic.append(input())
 
#for row in pic:
#    print(row)
 
for i in range(W+2):
    print("#",end="")
print()
 
for i in range(H):
    print("#"+pic[i]+"#")
 
for i in range(W+2):
    print("#",end="")

Buggy python submission (verdict: Runtime Error):
H,W = buf.split()
H = int(H)
W = int(W)
pic = []

for i in range(H):
    pic.append(input())

#for row in pic:
#    print(row)

for i in range(W+2):
    print("#",end="")
print()

for i in range(H):
    print("#"+pic[i]+"#")

for i in range(W+2):
    print("#",end="")
print()

Fixed submission:
buf = input()
H,W = buf.split()
H = int(H)
W = int(W)
pic = []
 
for i in range(H):
    pic.append(input())
 
#for row in pic:
#    print(row)
 
for i in range(W+2):
    print("#",end="")
print()
 
for i in range(H):
    print("#"+pic[i]+"#")
 
for i in range(W+2):
    print("#",end="")