Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
s=input(); if s in "aiueo" print("vowel") else print("consonant")

Fixed submission:
s = input()
if s in "aiueo":
  print("vowel")
else:
  print("consonant")

Buggy python submission (verdict: Runtime Error):
if input() in "aiueo" print("vowel") else print("consonant")

Fixed submission:
s = input()
if s in "aiueo":
  print("vowel")
else:
  print("consonant")
Buggy python submission (verdict: Runtime Error):
W,H = (int(num) for num in input().split())
p = [int(input()) for _ in range(W)]
p.sort()
q = [int(input()) for _ in range(H)]
q.sort()
p_cnt = H+1 #何本取るか
q_cnt = W+1
gr_cnt = (W+1) * (H+1) - 1
p_idx = 0
q_idx = 0
ans = 0

while gr_cnt > 0:
    if (p_idx < W and p[p_idx] <= q[q_idx]) or q_idx >= H:
        nt = min(p_cnt,gr_cnt)
        #print(gr_cnt,nt,p[p_idx])
        ans += p[p_idx] * nt
        gr_cnt -= nt
        q_cnt -= 1
        p_idx += 1
    else:
        nt = min(q_cnt,gr_cnt)
        #print(gr_cnt,nt,q[q_idx])
        ans += q[q_idx] * nt
        gr_cnt -= nt
        p_cnt -= 1
        q_idx += 1
    
        
print(ans)

Fixed submission:
W,H = (int(num) for num in input().split())
p = [int(input()) for _ in range(W)]
p.sort()
q = [int(input()) for _ in range(H)]
q.sort()
p_cnt = H+1 #何本取るか
q_cnt = W+1
gr_cnt = (W+1) * (H+1) - 1
p_idx = 0
q_idx = 0
ans = 0

while gr_cnt > 0:
    if (p_idx < W and q_idx < H and p[p_idx] <= q[q_idx]) or q_idx >= H:
        nt = min(p_cnt,gr_cnt)
        #print(gr_cnt,nt,p[p_idx])
        ans += p[p_idx] * nt
        gr_cnt -= nt
        q_cnt -= 1
        p_idx += 1
    elif (p_idx < W and q_idx < H and p[p_idx] > q[q_idx]) or p_idx >= W:
        nt = min(q_cnt,gr_cnt)
        #print(gr_cnt,nt,q[q_idx])
        ans += q[q_idx] * nt
        gr_cnt -= nt
        p_cnt -= 1
        q_idx += 1
    
        
print(ans)
Buggy python submission (verdict: Runtime Error):
n,t = list(map(int,input().split()))

m = 0
while m < n+1:
	if m*4 + (n-m)*2 == t:
      print('Yes')
      break
      
    m += 1
    
if m == (n+1):
  print('No')

Fixed submission:
n,t = list(map(int,input().split()))
 
m = 0
while m < n+1:
  if m*4 + (n-m)*2 == t:
    print('Yes')
    break
      
  m += 1
    
if m == (n+1):
  print('No')
Buggy python submission (verdict: Time Limit Exceeded):
N, K = input().split()
n = int(N)
k = int(K)

t = n

if n % k == 0:
  print(0)
else:
  while True:
    n = abs(n - k)
    if n >= t:
      break
    t = n

  print(t)	

Fixed submission:
N, K = input().split()
n = int(N)
k = int(K)

t = n

if n % k == 0:
  print(0)
else:
  if n < k:
    a = abs(n - k)
    b = abs(a-k)
    if a < b:
      print(a)
    else:
      print(b)
  else:
  	x = n % k
  	print(k - x)

Buggy python submission (verdict: Time Limit Exceeded):
N, K = input().split()
n = int(N)
k = int(K)

t = n

while True:
  n = abs(n - k)
  if n > t:
    break
  t = n
    
print(t)

Fixed submission:
N, K = input().split()
n = int(N)
k = int(K)

t = n

if n % k == 0:
  print(0)
else:
  if n < k:
    a = abs(n - k)
    b = abs(a-k)
    if a < b:
      print(a)
    else:
      print(b)
  else:
  	x = n % k
  	print(k - x)
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = input().split()
 
for i in range(n):
  b = a[:]
  del b[i]
  k = 0
  c = set(b)
  for t in c:
    num = b.count(t)
    for i in range(num):
      k += i
  print(k)

Fixed submission:
n, m = input().split()

n = int(n)
m = int(m)
j = 0
for i in range(1, n):
  j += i
  
for i in range(1, m):
  j += i
  
print(j)
Buggy python submission (verdict: Runtime Error):
L = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(L[int(input()]-1))

Fixed submission:
L = [1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51]

print(L[int(input())-1])
Buggy python submission (verdict: Runtime Error):
a8, a10 = input().split(' ')
a8 = int(a8)
a10 = int(a10)
 
value1 = int(a8 / 0.08)
value2 = int(a10 / 0.1)
if int(value1 * 0.1) == a10:
  if value1 > value2:
    print(value1)
  else:
    print(value1)
elif int(value2 * 0.08) == a8:
  if value1 > value2:
    print(value1)
  else:
    print(value1)
else:
  print(-1)

Fixed submission:
s = input()

if 'A' in s and 'B' in s:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
a8, a10 = input().split(' ')
a8 = int(a8)
a10 = int(a10)
 
value1 = int(a8 / 0.08)
value2 = int(a10 / 0.1)
if int(value1 * 0.1) == a10:
  print(value1)
elif int(value2 * 0.08 == a8):
  print(value2)
else:
  print(-1)

Fixed submission:
s = input()

if 'A' in s and 'B' in s:
  print('Yes')
else:
  print('No')

Buggy python submission (verdict: Runtime Error):
a8, a10 = input().split(' ')
a8 = int(a8)
a10 = int(a10)
 
value1 = int(a8 / 0.08)
value2 = int(a10 / 0.1)
if int(value1 * 0.1) == a10:
  print(value1)
elif int(value2 * 0.08 == a8):
  print(value2)
else:
  print(-1)

Fixed submission:
s = input()

if 'A' in s and 'B' in s:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
a8, a10 = input().split(' ')
a8 = int(a8)
a10 = int(a10)
 
value1 = int(a8 / 0.08)
value2 = int(a10 / 0.1)

if int(value1 * 0.1) == a10:
  if value1 > value2:
    print(value1)
  else:
    print(value2)
elif int(value2 * 0.08 == a8):
  if value1 > value2:
    print(value1)
  else:
    print(value2)
else:
  print(-1)

Fixed submission:
s = input()
n, a, b = s.split(' ')
n = int(n)
a = int(a)
b = int(b)

na = n // (a+b) * a
if n % (a+b) >= a:
  na += a
else:
  na += (n % (a + b))
  
print(na)
Buggy python submission (verdict: Runtime Error):
s = input()
l_s = s.split(' ')

a = sum(l_s)

if a <= 21:
  print("win")
else:
  print("bust")

Fixed submission:
l_s = input().split(' ')
i_s = [int(i) for i in l_s]
a = sum(i_s)
 
if a <= 21:
  print('win')
else:
  print('bust')
Buggy python submission (verdict: Runtime Error):
n = input()
s = input()
i = input()
 
l = []
for i, c in enumerate(s):
  l.append(* if c != s[i-1] else c)
    
''.join(l)
 
print(l)

Fixed submission:
n = input()
s = input()
i = int(input())
 
l = list(s)
for j, c in enumerate(l):
  if c != s[i-1]:
    l[j] = '*'
    
l = ''.join(l)
 
print(l)

Buggy python submission (verdict: Runtime Error):
n = input()
s = input()
i = input()

l = list(s)
for i, c in enumerate(l):
  if c != s[i-1]:
    l[i] = *
    
''.join(l)

print(l)

Fixed submission:
n = input()
s = input()
i = int(input())
 
l = list(s)
for j, c in enumerate(l):
  if c != s[i-1]:
    l[j] = '*'
    
l = ''.join(l)
 
print(l)
Buggy python submission (verdict: Runtime Error):
s = input()

wa = False

if s[0] != 'A':
  wa = True
print(s[2:-1])
if s[2:-1].count('C') != 1:
  wa = True

l_s = list(s)
  
del l_s[l_s.index('A')]

if 'C' in l_s:
	del l_s[l_s.index('C')]

for c in l_s:
  print(c.lower())
  if c != c.lower():
    wa = True
    
if wa == True:
  print('WA')
else:
  print('AC')

Fixed submission:
s = input()

wa = False

if s[0] != 'A':
  wa = True
if s[2:-1].count('C') != 1:
  wa = True

l_s = list(s)
  
if 'A' in l_s:
	del l_s[l_s.index('A')]

if 'C' in l_s:
	del l_s[l_s.index('C')]

for c in l_s:
  if c != c.lower():
    wa = True
    
if wa == True:
  print('WA')
else:
  print('AC')

Buggy python submission (verdict: Runtime Error):
s = input()

wa = False

if s[0] != 'A':
  wa = True

if s[2:-1].count('C') != 1:
  wa = True

l_s = list(s)
  
del l_s[l_s.index('A')]
del l_s[l_s.index('C')]

for c in l_s:
  if c != c.lower():
    wa = True
    
if wa == True:
  print('WA')
else:
  print('AC')

Fixed submission:
s = input()

wa = False

if s[0] != 'A':
  wa = True
if s[2:-1].count('C') != 1:
  wa = True

l_s = list(s)
  
if 'A' in l_s:
	del l_s[l_s.index('A')]

if 'C' in l_s:
	del l_s[l_s.index('C')]

for c in l_s:
  if c != c.lower():
    wa = True
    
if wa == True:
  print('WA')
else:
  print('AC')
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())

a = 1

while a <= n:
  b = a
  a **= 2
  
print(b)

Fixed submission:
n = int(input())
 
a = 1
b = 0
c = 0

 
while c <= n:
  b = c
  c = a ** 2
  a += 1
  
print(b)
Buggy python submission (verdict: Runtime Error):
a = map(int,input().split())

for i in a:
  if a.count(i) > 1:
    print(i)
    break

Fixed submission:
a = list(map(int,input().split()))
 
for i in a:
  if a.count(i) <= 1:
    print(i)
    break
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a = [int(input()) for i in range(n)]

k = 1
while a.count(-1) <= n:
    t = a[k-1]
    a[k-1] = -1
    k = t
#    print(t)
#    print(a)
    if k == -1:
        break
    elif k == 2:
        break

if a.count(-1) >= n or k == -1:
    print(-1)
else:
    print(a.count(-1))

Fixed submission:
n = int(input())
a = [int(input()) for i in range(n)]

if 2 in a:
    k = 1
    while True:
        t = a[k-1]
        a[k-1] = -1
        k = t
#        print(t)
#        print(a)
        if k == -1:
            break
        elif k == 2:
            break
        
    if k == -1:
        print(-1)
    else:
        print(a.count(-1))
else:
    print(-1)
Buggy python submission (verdict: Runtime Error):
s = input()

for c in s:
    x += 1 if c == 'I' else -1
    
print(max(x))

Fixed submission:
s = input()
s = input()
x = 0
l_x = [0]
for c in s:
  x += 1 if c == 'I' else -1
  l_x.append(x)
    
print(max(l_x))
Buggy python submission (verdict: Runtime Error):
input_line = input().split(" ")
X = int(input_line[0])
Y = int(input_line[1])
Pat = 0
for i in range(X + 1):
  	C = i
	T = X - i
    Cf = C * 2
    Tf = T * 4
    F = Cf + Tf
	if Y == F:
      Pat = Pat + 1
if Pat >= 0:
  print("Yes")
else:
  print("No")
   
  
  
  


Fixed submission:
input_line = input().split(" ")
X = int(input_line[0])
Y = int(input_line[1])
Pat = 0
for i in range(X + 1):
  C = i
  T = X - i
  Cf = C * 2
  Tf = T * 4
  F = Cf + Tf
  if Y == F:
      Pat = Pat + 1
if Pat > 0:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
input_line = input()
S = int(input_line[0])
W = int(input_line[1])
if S > W:
  print("safe")
else:
  print("unsafe")


Fixed submission:
input_line = input().split(" ")
S = int(input_line[0])
W = int(input_line[1])
if S > W:
  print("safe")
else:
  print("unsafe")

Buggy python submission (verdict: Runtime Error):
input_line = int(input())
S = input_line[0]
W = input_line[1]
if S > W:
  print("safe")
else:
  print("unsafe")

Fixed submission:
input_line = input().split(" ")
S = int(input_line[0])
W = int(input_line[1])
if S > W:
  print("safe")
else:
  print("unsafe")
Buggy python submission (verdict: Runtime Error):
n,a,b,=map(int,input().split())
if a*n>b:
    print(b)
if a*n<b:
    print(a*n)
if a*n==b:
    print(a*n)

Fixed submission:
a, b = map(int, input().split())
if a > b: print(a + (a - 1))
if b > a: print(b + (b - 1))
if b == a: print(a + b)

Buggy python submission (verdict: Runtime Error):
n,a,b,=map(int,input().split())
if a*n>b:
    print(b)
if a*n<b:
    print(a*n)
if a*n==b:
    print(a*n)

Fixed submission:
a, b = map(int, input().split())
if a > b: print(a + (a - 1))
if b > a: print(b + (b - 1))
if b == a: print(a + b)
Buggy python submission (verdict: Runtime Error):
X, N = map(int, input().split())
p = list(map(int, input().split()))


if N == 0:
    print(X)

for i in range(102):
    if X - i not in p:
        print(x - i)
        exit()
    
    if X + i not in p:
        print(x + i)
        exit()


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


if N == 0:
    print(X)
    exit()

for i in range(102):
    if X - i not in p:
        print(X - i)
        exit()
    
    if X + i not in p:
        print(X + i)
        exit()

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


if N == 0:
    print(X)

for i in range(102):
    if x - i not in p:
        print(x - i)
        exit()
    
    if x + i not in p:
        print(x + i)
        exit()


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


if N == 0:
    print(X)
    exit()

for i in range(102):
    if X - i not in p:
        print(X - i)
        exit()
    
    if X + i not in p:
        print(X + i)
        exit()
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

for i in range(N):
    print(A.count(i + 1))

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

ans = [0] * N
for i in A:
    ans[i - 1] += 1

[print(i) for i in ans]

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

count = 0
for i in range(N):
    for j in range(N - 1):
        if A[j] == i + 1:
            count += 1
    print(count)
    count = 0


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

ans = [0] * N
for i in A:
    ans[i - 1] += 1

[print(i) for i in ans]

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))

count = 0
for i in range(N):
    for j in range(N - 1):
        if A[j] == i + 1:
            count += 1
    print(count)
    count = 0


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

ans = [0] * N
for i in A:
    ans[i - 1] += 1

[print(i) for i in ans]
Buggy python submission (verdict: Runtime Error):
X = input()
nfh = X // 500
nf = (X - 500 * nfh) // 5
happy = 1000 * nfh + 5 * nf
print(happy)

Fixed submission:
X = int(input())
nfh = X // 500
nf = (X - 500 * nfh) // 5
happy = 1000 * nfh + 5 * nf
print(happy)

Buggy python submission (verdict: Runtime Error):
X = input()
n500 = X // 500
n5 = (X - 500 * n500) // 5
happy = 1000 * n500 + 5 * n5
print(happy)

Fixed submission:
X = int(input())
nfh = X // 500
nf = (X - 500 * nfh) // 5
happy = 1000 * nfh + 5 * nf
print(happy)

Buggy python submission (verdict: Runtime Error):
X = input()
n500 = X // 500
n5 = (X - 500 * n500) // 5
happy = 1000 * n500 + 5 * n5
print(happy)

Fixed submission:
X = int(input())
nfh = X // 500
nf = (X - 500 * nfh) // 5
happy = 1000 * nfh + 5 * nf
print(happy)
Buggy python submission (verdict: Runtime Error):
N, Y = map(int, input().split())

for a in range(N + 1):
    for b in range(N + 1 - a):
        if 10000 * a + 5000 * b + 1000 * c == Y:
            print(a, b, N - a - b)
            break
    else:
        continue
    break
else:
    print(-1, -1, -1)

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

for a in range(N + 1):
    for b in range(N + 1 - a):
        if 10000 * a + 5000 * b + 1000 * (N - a - b) == Y:
            print(a, b, N - a - b)
            break
    else:
        continue
    break
else:
    print(-1, -1, -1)
Buggy python submission (verdict: Runtime Error):
n = int(input())
A = [int(i) for i in input().split()]
A.insert(0, 0)
dp = list([0] * 2 for i in range(n+1))
dp[0][0] = 0
dp[0][1] = -1000000000000
for i in range(1, n) :
    dp[i][0] = max(dp[i-1][0] + A[i], dp[i-1][1] - A[i])
    dp[i][1] = max(dp[i-1][0] - A[i], dp[i-1][1] + A[i])
ans = max(dp[n-1][0] + A[n], dp[n-1][1] - A[n])    

print(ans)


Fixed submission:
A, B, T = map(int, input().split())
Ans  = T // A * B
print(Ans)

Buggy python submission (verdict: Runtime Error):

def gcd(a, b) :
    if b == 0 :
        return a
    ret = gcd(b, a % b)
    return ret

def main( ) :

  n = int(input())
  v = [int(i) for i in input().split()]

  l = [0 for i in range(n)]
  r = l[:]

  for i in range(1, n) :
      l[i] = gcd(l[i-1], v[i-1])
      r[-i-1] = gcd(r[-i], v[-i])

  ans = 0
  for i in range(n) :
      ans = max(ans, gcd(l[i], r[i]))
  print(ans)
                 

main()


Fixed submission:
A, B, T = map(int, input().split())
Ans  = T // A * B
print(Ans)
Buggy python submission (verdict: Runtime Error):
import numpy as np
K, N = map(int, input().split())
A = input().split()
diff = np.append(np.array(A[1:]) - np.array(A[:-1]), K - A[-1])
diff = np.delete(diff, np.argmax(diff))
print(diff.sum())

Fixed submission:
import numpy as np
K, N = map(int, input().split())
A = np.array(list(map(int, input().split())))
diff = np.append(A[1:] - A[:-1], K + A[0] - A[-1])
print(np.delete(diff, np.argmax(diff)).sum())
Buggy python submission (verdict: Runtime Error):
INPUT = [input() for i in range(2)]
INPUT = list(map(int, INPUT))

def check_even(l):
    return sum([i % 2 for i in INPUT]) == 0

check_even(INPUT)

count = 0
while True:
    if check_even(INPUT):
        INPUT = [i / 2 for i in INPUT]
        count+=1
    else:
        break
print(count)

Fixed submission:
_ = input()
INPUT = list(map(int, input().split()))

def check_even(l):
    return sum([i % 2 for i in INPUT]) == 0

check_even(INPUT)

count = 0
while True:
    if check_even(INPUT):
        INPUT = [i / 2 for i in INPUT]
        count+=1
    else:
        break
print(count)
Buggy python submission (verdict: Runtime Error):
46 4 40 5

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

while True:
    c -= b
    if c<=0:
        print("Yes")
        exit()
        
    a -= d
    if a<=0:
        print("No")
        exit()
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = list(map(int, input().split()))
flag = 0

for i in range(n):
	if i+1 == p[i]:
      	flag += 1

             

if flag >= n-2:   
      print('YES')
else:
      print('NO')

Fixed submission:
n = int(input())
p = list(map(int, input().split()))
flag = 0

for i in range(n):
  if i+1 == p[i]:
    flag += 1

             

if flag >= n-2:
  print('YES')
else:
  print('NO')
Buggy python submission (verdict: Runtime Error):
import math

n, k = map(int, input().split())
if n > k:
	if n+1 >= 2*k:
		for i in range(k):
			j = i+1
			c_blue = (math.factorial(n-k+1))//((math.factorial(j))*(math.factorial(n-k+1-j)))
			c_div = (math.factorial(k-1))//((math.factorial(j-1))*(math.factorial(k-1-j+1)))
			comb = c_blue * c_div
			print(comb % 1000000007)
			
	else :
		for i in range(n-k+1):
			j = i+1
			c_blue = (math.factorial(n-k+1))//((math.factorial(j))*(math.factorial(n-k+1-j)))
			c_div = (math.factorial(k-1))//((math.factorial(j-1))*(math.factorial(k-1-j+1)))
			comb = c_blue * c_div
			print(comb % 1000000007)
		for _ in range(2*k -n -1):
			print(0)
else:
	print(1)
	for i in range(n-1):
		print(0)

Fixed submission:
import collections

s = input()
c = collections.Counter(s)

flag = 0
for i in range(4):
	word = s[i]
	if c[word] != 2:
		flag = 1
		break
	
if flag == 1:
	print("No")
else :
	print("Yes")
Buggy python submission (verdict: Runtime Error):
n, a, b, c, d = map(int, input().split())
s = input()

if "##" in s[a:c+1] or "##" in s[b:d+1] :
  print("No")
elif c<d:
  print("Yes")
elif "..." in s[b-2:d] :#以下 d<c の場合
  print("Yes")
  else:
    print("No")


Fixed submission:
n, a, b, c, d = map(int, input().split())
s = input()

if "##" in s[a:c+1] or "##" in s[b:d+1] :
  print("No")
elif c<d:
  print("Yes")
elif "..." in s[b-2:d+1] :#以下 d<c の場合
  print("Yes")
else :
  print("No")

Buggy python submission (verdict: Runtime Error):
n, a, b, c, d = map(int, input().split())
s = input()

if "##" in s[a-1:c] or "##" in s[b-1:d] :
  print("No")
elif c<d:
  print("Yes")
elif "..." in s[b-2:b+3] :#以下 d<c の場合
  print("Yes")
  else:
    print("No")


Fixed submission:
n, a, b, c, d = map(int, input().split())
s = input()

if "##" in s[a:c+1] or "##" in s[b:d+1] :
  print("No")
elif c<d:
  print("Yes")
elif "..." in s[b-2:d+1] :#以下 d<c の場合
  print("Yes")
else :
  print("No")
Buggy python submission (verdict: Runtime Error):
N, x =map(int, input().split())
a = sorted(map(int, input().split()))

i = 0

while (i<N) and (x>=0):
    x -= a[i]
    if x>=0:
    i += 1

print(i)


Fixed submission:
N, x =map(int, input().split())
a = sorted(map(int, input().split()))

i = 0

while (i<N) and (x>=0):
    x -= a[i]
    if x>=0:
        i += 1

if (i == N) and (x>0) :
    print(N-1)
else:
    print(i)
Buggy python submission (verdict: Runtime Error):
N = int(input())
flag = 0

for cake in range(26):
    for donut in range(15):
        if cake*4 + donut*7 == N:
            flag = 1
            break
    if flag == 1:
        break

if flag = 1:
    print("Yes")
else :
    print("No")


Fixed submission:
N = int(input())
flag = 0

for cake in range(26):
    for donut in range(15):
        if cake*4 + donut*7 == N:
            flag = 1
            break
    if flag == 1:
        break

if flag == 1:
    print("Yes")
else :
    print("No")
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort()

# range=A[N-1]-A[0]

range = 0

for i in range(N):
    for j in range(i+1,N):
        x = A[j]-A[i]
        range = max([range,x])

print(range)


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

range=A[N-1]-A[0]

print(range)

Buggy python submission (verdict: Runtime Error):
N = int(input())
A = list(map(int, input().split()))
A.sort()
range = 0

for i in range(N+1):
    for j in range(i+1,N+1):
        x = A[j]-A[i]
        range = max([range,x])

print(range)


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

range=A[N-1]-A[0]

print(range)
Buggy python submission (verdict: Runtime Error):
N = int(input())
s = []
for _ in range(N):
    s.append(input())
    
M = int(input())
t = []
for _ in range(M):
    t.append(input())


mine = 0
    
flags = [1] * N

for i in range(N):
    plus = 1
    minus = 0
    
    if flags[i] == 0:
        continue
        
    if flags[i] == 1:
        flags[i] = 0
    
    for j in range(i+1, N):
        if s[i] == s[j]:
            plus += 1
            flags[j] = 0
            
    for k in range(M):
        if s[i] == t[k]:
            minus += 1
            
    mine = max[mine, plus - minus]       

    
print(mine)

Fixed submission:
N = int(input())
s = []
for _ in range(N):
    s.append(input())
    
M = int(input())
t = []
for _ in range(M):
    t.append(input())


mine = 0
    
flags = [1] * N

for i in range(N):
    plus = 1
    minus = 0
    
    if flags[i] == 0:
        continue
        
    if flags[i] == 1:
        flags[i] = 0
    
    for j in range(i+1, N):
        if s[i] == s[j]:
            plus += 1
            flags[j] = 0
            
    for k in range(M):
        if s[i] == t[k]:
            minus += 1
            
    mine = max([mine, plus - minus]) 

    
print(mine)
Buggy python submission (verdict: Runtime Error):
S = input()

S[3] = 8
print(S)


Fixed submission:
S = input()

S = S.replace('7','8',1)
print(S)