Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
n =  int(input())
arr = input().split()
arr = [int(x) for x in arr]
def hhhh(arr):
    res = []
    for j in range(1,len(arr)):
        for i in range(j):
            #print(arr[i:j])
            if all([arr[i:j][k] >= arr[i:j][k+1] for k in range(len(arr[i:j])-1)]):
                    res.append(j-i)
                    
    
    return max(res)
a = hhhh(arr)
print(a)

Fixed submission:
n =  int(input())
arr = input().split()
arr = [int(x) for x in arr]
counts = []
temp = 0
for i in range(n-1):
    if arr[i] >= arr[i+1]:
        temp += 1
        #print(temp)
        counts.append(temp)
    else:
        #counts.append(temp)
        temp = 0
if not counts:
    print(0)
else:
    print(max(counts))

Buggy python submission (verdict: Runtime Error):
n =  int(input())
arr = input().split()
arr = [int(x) for x in arr]
def hhhh(arr):
    res = []
    for j in range(1,len(arr)):
        for i in range(j):
            #print(arr[i:j])
            if all([arr[i:j][k] >= arr[i:j][k+1] for k in range(len(arr[i:j])-1)]):
                    res.append(j-i)
                    
    
    return max(res)
hhhh(arr)

Fixed submission:
n =  int(input())
arr = input().split()
arr = [int(x) for x in arr]
counts = []
temp = 0
for i in range(n-1):
    if arr[i] >= arr[i+1]:
        temp += 1
        #print(temp)
        counts.append(temp)
    else:
        #counts.append(temp)
        temp = 0
if not counts:
    print(0)
else:
    print(max(counts))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

for i in range(1,1000000):
    for j in range(1,i+1):
        if (i*j) == N:
            break
    else:
        continue
    break

ans = i + j - 2

print(ans)

Fixed submission:
N = int(input())

divisors = []
for i in range(1, int(N**0.5)+1):
    if N % i == 0:
        divisors.append(i+N//i)

print(min(divisors)-2)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
h = list(map(int,input().split()))

m = 0

for i in range(n-1):
  count =0
  for j in range(i,n-1):
    if h[j]>=h[j+1]:
      count+=1
    else:
      break
      
  if m<count and count>0:
    m = count
    
print(m)

Fixed submission:
n = int(input())
h = list(map(int,input().split()))

m = 0
a =0
loop = True

while loop:
  count =0
  for j in range(a,n-1):
    if h[j]>=h[j+1]:
      count+=1
    else:
      a = j+1
      break      
  if m<count and count>0:
    m = count
    
  if a > n-2 or j >= n-2:
        loop = False
      
print(m)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
m = 0

for i in range(1,n):
    m += i
    
print(m)

Fixed submission:
n = int(input())
m = (n-1)*n//2

print(m)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
m = 0

for i in range(1,n+1):
  if i==n :
    m += i%1
  else:
    m += i%(i+1)
    
print(m)
  

Fixed submission:
n = int(input())
m = (n-1)*n//2

print(m)
Buggy python submission (verdict: Runtime Error):
a = int(input())
s = input()

if a>=3200:
  print(s)
else if a<3200:
  print('red')

Fixed submission:
a = int(input())
s = input()

if a>=3200:
  print(s)
elif a<3200:
  print('red')
Buggy python submission (verdict: Runtime Error):
a,d,x = map(int,input().split())

for i in range(10):
  s = r*x-d
  print(s)
  x = s
  

Fixed submission:
r,d,x = map(int,input().split())

for i in range(10):
  s = r*x-d
  print(s)
  x = s
Buggy python submission (verdict: Runtime Error):
n = int(input())
a = 0
b = 0

for i in range(1, n+1):
    if n%i = 0:
        if a == n/i:
            b = i
        else:
            a = i

print(a+b-2)

Fixed submission:
import sys
import math

n = int(input())
ans = 0

for i in range(int(math.sqrt(n)), 0, -1):
    if n%i is 0:
        ans = int(n/i + i - 2)
        break
if ans is not 0:
    print(ans)
else:
    print(n-1)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a_l = list(map(int, input().split()))

for i in range(n):
    if i != n-1:
        print(a_l.index(i+1)+1, end=" ")
    else:
        print(a_l.index(i+1)+1)


Fixed submission:
n = int(input())
ans = [0]*n

a_l = list(map(int, input().split()))

for i in range(n):
    ans[a_l[i]-1] += i+1

st = ''
for a in ans:
    st += str(a)+' '

print(st)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
a_l = list(map(int, input().split()))
ans = ''

for i in range(1,n+1):
    ans += str(a_l.index(i)+1)+' '

print(ans)


Fixed submission:
n = int(input())
ans = [0]*n

a_l = list(map(int, input().split()))

for i in range(n):
    ans[a_l[i]-1] += i+1

st = ''
for a in ans:
    st += str(a)+' '

print(st)
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = [map(int, input()) for i in range(n)]

print(sum(p)-int(max(d)/2))

Fixed submission:
n = int(input())
p = list(map(int, [input() for i in range(n)]))

print(int(sum(p)-max(p)/2))
Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
h = sorted(list(map(int, [input() for i in range(n)])))
ans = h[n-1]
for j in range(n-k+1):
    ans = min(ans, (h[j+k]-h[j]))
print(ans)

Fixed submission:
N, K = map(int, input().split())
h = [int(input()) for i in range(N)]
h.sort()
print(min(h[i+K-1] - h[i] for i in range(N-K+1)))

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
2 h = [int(input()) for i in range(N)]
3 h.sort()
4 print(min(h[i+K-1] - h[i] for i in range(N-K+1)))

Fixed submission:
N, K = map(int, input().split())
h = [int(input()) for i in range(N)]
h.sort()
print(min(h[i+K-1] - h[i] for i in range(N-K+1)))

Buggy python submission (verdict: Time Limit Exceeded):
n,k = map(int,input().split())
h = sorted(list(map(int, [input() for i in range(n)])))
ans = int(max(h))

for j in range(n-k+1):
    ans = min(ans, (max(h[j:j+k])-min(h[j:j+k])))
print(ans)

Fixed submission:
N, K = map(int, input().split())
h = [int(input()) for i in range(N)]
h.sort()
print(min(h[i+K-1] - h[i] for i in range(N-K+1)))

Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
h = list(map(int, [input() for i in range(n)])).sort()
dif = []
for j in range(n-k+1):
  dif.appned(max(h[j:j+k-1])-min(h[j:j+k-1]))
print(min(dif))


Fixed submission:
N, K = map(int, input().split())
h = [int(input()) for i in range(N)]
h.sort()
print(min(h[i+K-1] - h[i] for i in range(N-K+1)))

Buggy python submission (verdict: Runtime Error):
n,k = map(int,input().split())
h = list(map(int, [input() for i in range(n)])).sort()
dif = []
for j in range(n-k+1):
  dif.appned(max(h[i:i+k-1])-min(h[i:i+k-1]))
print(min(dif))

Fixed submission:
N, K = map(int, input().split())
h = [int(input()) for i in range(N)]
h.sort()
print(min(h[i+K-1] - h[i] for i in range(N-K+1)))
Buggy python submission (verdict: Runtime Error):
s = list(map(int, input()))
print(min(abs(s[i+2]*100+s[i+1]*10+s[i]-753)) for i in range(len(s)-2)

Fixed submission:
s = list(map(int, input()))
print(min(abs(s[i+2]+s[i+1]*10+s[i]*100-753) for i in range(len(s)-2)))
Buggy python submission (verdict: Runtime Error):
x,y = int(input())
print(x+int(y/2))

Fixed submission:
x, y = map(int, input().split())
print(x+int(y/2))
Buggy python submission (verdict: Runtime Error):
A = list(map(int, input().split(' ')))

def multi_all(A):
  s = 1
  for a in A:
    s *= a
  return s

M = multi_all(A)

if N == 1: print(A[0])
else:
  S = 0
  for a in A:
    S += M / a
  print(M/S)


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

def multi_all(A):
  s = 1
  for a in A:
    s *= a
  return s

M = multi_all(A)

if N == 1: print(A[0])
else:
  S = 0
  for a in A:
    S += M / a
  print(M/S)
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
count = 0
for i in range(len(S)):
    if S[i] == 'W':
        count += S[0:i].count('B')
print(count)



Fixed submission:
S = input()
count = 0
ans = 0
for i in range(len(S)):
    if S[i] == 'W':
        ans += count
    else:
        count += 1
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
NK = list(map(int, input().split()))
a = [0]*NK[0]
for i in range(len(a)):
    a[i] = int(input())
a.sort()
N = NK[0]
K = NK[1]

b = [0]*K
offsets = [0]*(N-K+1)
for i in range(len(offsets)):
    for j in range(K):
        b[j] = a[i+j]
    offsets[i] = b[K-1] - b[0]

print(min(offsets))


Fixed submission:
NK = list(map(int, input().split()))
a = [0]*NK[0]
for i in range(len(a)):
    a[i] = int(input())
a.sort()
N = NK[0]
K = NK[1]

minimum = a[N-1]
for i in range(N-K+1):
    offset = a[i+K-1] - a[i]
    if minimum > offset:
        minimum = offset

print(minimum)

Buggy python submission (verdict: Runtime Error):
NK = list(map(int, input().split()))
a = [0]*NK[0]
for i in range(len(a)):
    a[i] = int(input())
a.sort()

b = [0]*NK[1]
offsets = [0]*(NK[0]-NK[1]+1)
for i in range(len(offsets)):
    for j in range(NK[1]):
        b[j] = a[i+j]
    offsets[i] = b[K-1] - b[0]

print(min(offsets))


Fixed submission:
NK = list(map(int, input().split()))
a = [0]*NK[0]
for i in range(len(a)):
    a[i] = int(input())
a.sort()
N = NK[0]
K = NK[1]

minimum = a[N-1]
for i in range(N-K+1):
    offset = a[i+K-1] - a[i]
    if minimum > offset:
        minimum = offset

print(minimum)

Buggy python submission (verdict: Time Limit Exceeded):
NK = list(map(int, input().split()))
a = [0]*NK[0]
for i in range(len(a)):
    a[i] = int(input())
a.sort()

b = [0]*NK[1]
offsets = [100]*(NK[0]-NK[1]+1)
for i in range(len(offsets)):
    for j in range(NK[1]):
        b[j] = a[i+j]
    b.sort()
    offsets[i] = b[len(b)-1] - b[0]

print(min(offsets))


Fixed submission:
NK = list(map(int, input().split()))
a = [0]*NK[0]
for i in range(len(a)):
    a[i] = int(input())
a.sort()
N = NK[0]
K = NK[1]

minimum = a[N-1]
for i in range(N-K+1):
    offset = a[i+K-1] - a[i]
    if minimum > offset:
        minimum = offset

print(minimum)
Buggy python submission (verdict: Runtime Error):
str = input()

day = {"MON":1, "TUE":2, "WED":3, "THU":4, "FRI":5, "SAT":6 "SUN":7}

print(day["SUN"]() - day[str]())

Fixed submission:
str = input()
 
day = {"MON":1, "TUE":2, "WED":3, "THU":4, "FRI":5, "SAT":6, "SUN":7}
 
if str == "SUN":
    print(7)
else:
    print(day["SUN"] - day[str])
Buggy python submission (verdict: Runtime Error):
N=int(input())
nums = [int(x) for x in input().split()]

ans = [0]*N
for i in nums:
    ans[i-1] = nums.index(i)+1

print(*ans)

Fixed submission:
N = int(input())
ans =0
for i in range(N+1):
    if i%2 != 0:
        ans += 1
print(ans/N)
Buggy python submission (verdict: Runtime Error):
N = int(input())
ans = 0
for i in range(1,N+1):
    counter = 0
    real_number = i
    while i %2 == 0:
        i //= 2
        counter += 1
    if counter > ans:
        ans = counter
        ans_number = real_number
print(ans_number)

Fixed submission:
N = int(input())
ans = 0
for i in range(1,N+1):
    counter = 0
    real_number = i
    while i > 0:
        i //= 2
        counter += 1
    if counter > ans:
        ans = counter
        ans_number = real_number
print(ans_number)
Buggy python submission (verdict: Runtime Error):
a, b, c = map(int, input().split())
if (100*r + 10*g + b)%4 == 0:
    print("YES")
else:
    print("NO")

Fixed submission:
r, g, b = map(int, input().split())
if (100*r + 10*g + b)%4 == 0:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
r = int(input())
g = int(input())
b = int(input())
if (100*r + 10*g + b)%4 == 0:
    print("YES")
else:
    print("NO")

Fixed submission:
r, g, b = map(int, input().split())
if (100*r + 10*g + b)%4 == 0:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = str(input())
if N % 2 != 0:
    print("No")
if S[0:N/2] * 2 == S:
    print("Yes")
else:
    print("No")


Fixed submission:
N = int(input())
S = str(input())
if S[0:N//2] * 2 == S:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = str(input())
if S[0:N * 0.5] * 2 == S:
    print("Yes")
else:
    print("No")


Fixed submission:
N = int(input())
S = str(input())
if S[0:N//2] * 2 == S:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = str(input())
if S[0:N/2] * 2 == S:
    print("Yes")
else:
    print("No")


Fixed submission:
N = int(input())
S = str(input())
if S[0:N//2] * 2 == S:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = str(input())
if S[0:N/2] * 2 = S:
    print("Yes")
else:
    print("No")


Fixed submission:
N = int(input())
S = str(input())
if S[0:N//2] * 2 == S:
    print("Yes")
else:
    print("No")

Buggy python submission (verdict: Runtime Error):
N = int(input())
S = int(input())
if S[0:N/2] * 2 = S:
    print("Yes")
else:
    print("No")


Fixed submission:
N = int(input())
S = str(input())
if S[0:N//2] * 2 == S:
    print("Yes")
else:
    print("No")
Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split(" "))
if 1 <= A, B <= 9:
    print(A * B)
else:
    print("-1")

Fixed submission:
A, B = map(int, input().split(" "))
if 1 <= A <= 9 and 1 <= B <= 9:
    print(A * B)
else:
    print("-1")
Buggy python submission (verdict: Runtime Error):
S = str(input())
if S[-3:] = "nny":
    print(Cloudy)
elif S[-2:] = "dy":
    print(Rainy)
else:
    print(Sunny)


Fixed submission:
S = str(input())
if S[-3:] == "nny":
    print("Cloudy")
elif S[-2:] == "dy":
    print("Rainy")
else:
    print("Sunny")

Buggy python submission (verdict: Runtime Error):
S = str(input())
if S[-3:] = "nny":
    print("Cloudy")
elif S[-2:] = "dy":
    print("Rainy")
else:
    print("Sunny")

Fixed submission:
S = str(input())
if S[-3:] == "nny":
    print("Cloudy")
elif S[-2:] == "dy":
    print("Rainy")
else:
    print("Sunny")
Buggy python submission (verdict: Runtime Error):
N = int(input())
A = map(int, input().split())
under = 0
for i in range(N):
    under += 1 / A[i]
print(1 / under)

Fixed submission:
N = int(input())
A = list(map(int, input().split()))
under = 0
for i in range(N):
    under += 1 / A[i]
print(1 / under)
Buggy python submission (verdict: Runtime Error):
A, B = int(input().split())
list = []
list.append(A + B)
list.append(A - B)
list.append(A * B)
print(max(list))


Fixed submission:
A, B = map(int, input().split())
list = []
list.append(A + B)
list.append(A - B)
list.append(A * B)
print(max(list))

Buggy python submission (verdict: Runtime Error):
A, B = int, input().split()
list = []
list.append(A + B)
list.append(A - B)
list.append(A * B)
print(max(list))

Fixed submission:
A, B = map(int, input().split())
list = []
list.append(A + B)
list.append(A - B)
list.append(A * B)
print(max(list))
Buggy python submission (verdict: Time Limit Exceeded):
A, B = map(int, input().split())
for K in range(10 ** 9):
    if abs(A - K) == abs(B - K):
        print(K)
    else:
        print("IMPOSSIBLE")


Fixed submission:
A, B = map(int, input().split())
if (A + B) % 2 != 0:
    print("IMPOSSIBLE")
else:
    print((A + B) // 2)

Buggy python submission (verdict: Runtime Error):
A, B = map(int, input().split())
for K in range(10 ** 9):
    if abs(A - K) == abc(B - K):
        print(K)
    else:
        print("IMPOSSIBLE")

Fixed submission:
A, B = map(int, input().split())
if (A + B) % 2 != 0:
    print("IMPOSSIBLE")
else:
    print((A + B) // 2)
Buggy python submission (verdict: Runtime Error):
N = int(input())
p = list(map(int, input().split()))
for i in range(N):
    for j in range(i + 1, N):
        if p[j - 1] < p[i] < p[j + 1] and p[i - 1] < p[j] < p[i + 1]:
            print("YES")
            exit()
        else:
            continue
print("NO")


Fixed submission:
N = int(input())
p = list(map(int, input().split()))
count = 0
for i in range(N):
    if p[i] != i + 1:
        count += 1
if count == 0 or count == 2:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
N = int(input())
p = list(map(int, input().split()))
for i in range(N):
    for j in range(i + 1, N):
        if p[j - 1] < p[i] < p[j + 1] and p[i - 1] < p[j] < p[i + 1]:
            print("YES")
        else:
            continue
print("NO")


Fixed submission:
N = int(input())
p = list(map(int, input().split()))
count = 0
for i in range(N):
    if p[i] != i + 1:
        count += 1
if count == 0 or count == 2:
    print("YES")
else:
    print("NO")

Buggy python submission (verdict: Runtime Error):
N = int(input())
p = list(map(int, input().split()))
for i in range(N):
    for j in range(i + 1, N):
        if p[j - 1] < p[i] < p[j + 1] and p[i - 1] < p[j] < p[i + 1]:
            print("YES")
        else:
            print("NO")


Fixed submission:
N = int(input())
p = list(map(int, input().split()))
count = 0
for i in range(N):
    if p[i] != i + 1:
        count += 1
if count == 0 or count == 2:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
ans = []
for i in range(1, N):
    ans.append(A * i + B / N * (N - i))
print(min(ans))


Fixed submission:
N, A, B = map(int, input().split())
if A * N < B:
    print(A * N)
else:
    print(B)

Buggy python submission (verdict: Runtime Error):
N, A, B = map(int, input().split())
ans = []
for i in range(1, N):
    ans.append(A * i + B * (N - i))
print(min(ans))

Fixed submission:
N, A, B = map(int, input().split())
if A * N < B:
    print(A * N)
else:
    print(B)
Buggy python submission (verdict: Runtime Error):
N, D = map(int, input().split())
X = list(map(int, input().split()))
count = 0
for i in range(N - 1):
    for j in range(i + 1, N):
        r = 0
        for k in range(D):
            r += (X[i][k] - X[j][k]) ** 2
        if r ** 0.5 % 1 == 0:
            count += 1
print(count)


Fixed submission:
N, D = map(int, input().split())
X = [list(map(int, input().split())) for _ in range(N)]
count = 0
for i in range(N - 1):
    for j in range(i + 1, N):
        r = 0
        for k in range(D):
            r += (X[i][k] - X[j][k]) ** 2
        if r ** 0.5 % 1 == 0:
            count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
N, D = map(int, input().split())
X = list(map(int, input().split()))
count = 0
for i in range(N):
    for j in range(i + 1, N):
        r = 0
        for k in range(D):
            r += (X[i][k] - X[j][k]) ** 2
        if r ** 0.5 % 1 == 0:
            count += 1
print(count)

Fixed submission:
N, D = map(int, input().split())
X = [list(map(int, input().split())) for _ in range(N)]
count = 0
for i in range(N - 1):
    for j in range(i + 1, N):
        r = 0
        for k in range(D):
            r += (X[i][k] - X[j][k]) ** 2
        if r ** 0.5 % 1 == 0:
            count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
n = int(input())
p = list(map(int, input().split()))
count = 0
for i in range(1, n):
    if p[i - 1] < p[i] < p[i + 1]:
        count += 1
print(count)


Fixed submission:
n = int(input())
p = list(map(int, input().split()))
count = 0
for i in range(1, n - 1):
    if p[i - 1] < p[i] < p[i + 1]:
        count += 1
    elif p[i + 1] < p[i] < p[i - 1]:
        count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
N, L = map(int, input().split())
flavor = []
for i in range(1, N + 1):
    flavor.append(L + i - 1)
print(sum(flavor) - min(abs(flavor)))



Fixed submission:
N, L = map(int, input().split())
flavor = []
for i in range(1, N + 1):
    flavor.append(L + i - 1)
import numpy as np
for j in flavor:
    if abs(j) == min(np.abs(flavor)):
        eat = j
print(sum(flavor) - eat)
Buggy python submission (verdict: Runtime Error):
N, X = map(int, input().split())
L = list(map(int, input().split()))
count = 0
location = 0
for i in range(N + 1):
    if location + L[i] <= X:
        count += 1
        location += L[i]
    else:
        break
print(count)

Fixed submission:
N, X = map(int, input().split())
L = list(map(int, input().split()))
count = 1
location = 0
for i in range(N):
    if location + L[i] <= X:
        count += 1
        location += L[i]
    else:
        break
print(count)
Buggy python submission (verdict: Runtime Error):
N = int(input())
l = []
for i in range(N):
    a = input().split()
    l.append([a[0], a[1], i + 1])
l.sort()
for i in range(N):
    print(a[i][2])

Fixed submission:
N = int(input())
l = []
for i in range(N):
    a = input().split()
    l.append([a[0], 100 - int(a[1]), i + 1])
l.sort()
for i in range(N):
    print(l[i][2])
Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
S = str(input())
if S[K - 1] == "A":
    S[K - 1] = "a"
    print("".join(S))
elif S[K - 1] == "B":
    S[K - 1] = "b"
    print("".join(S))
else:
    S[K - 1] = "c"
    print("".join(S))


Fixed submission:
N, K = map(int, input().split())
S = list(input())
if S[K - 1] == "A":
    S[K - 1] = "a"
    print("".join(S))
elif S[K - 1] == "B":
    S[K - 1] = "b"
    print("".join(S))
else:
    S[K - 1] = "c"
    print("".join(S))

Buggy python submission (verdict: Runtime Error):
N, K = map(int, input().split())
S = str(input())
if S[K - 1] == "A":
    S[K - 1] = "a"
    print(S)
elif S[K - 1] == "B":
    S[K - 1] = "b"
    print(S)
else:
    S[K - 1] = "c"
    print(S)

Fixed submission:
N, K = map(int, input().split())
S = list(input())
if S[K - 1] == "A":
    S[K - 1] = "a"
    print("".join(S))
elif S[K - 1] == "B":
    S[K - 1] = "b"
    print("".join(S))
else:
    S[K - 1] = "c"
    print("".join(S))
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = input()

ns = []

for ch in S:
        
    if ('A' <= ch and ch <= 'Z'):
        ns.append(chr((ord(ch) - ord('A') + N) % 26 + ord('A')))

O = "".join(ns)
print(O)

Fixed submission:
S = input()

mydict = {"SUN":7, "MON":6, "TUE":5, "WED":4, "THU":3, "FRI":2, "SAT":1} 

O = mydict[S]

print(O)
Buggy python submission (verdict: Runtime Error):
N=int(input())
c=0
rN=int(N**0.5)+1

for i in range(rN):
    xi = rN - i
    for j in range(N-xi) :
        yj= xi+j
        if ((xi)*(yj))==N:
            x=xi
            y=yj
            c=1
            break
    if c==1:break


d=x+y-2

print(d)

Fixed submission:
N=int(input())
c=0
d=10000000000000
rN=int(N**0.5)

for i in range(rN):
    if (N%(i+1)==0) :
        x=i+1
        y=int(N/(i+1))
        if d>(x+y):
            d=x+y

print(d-2)

Buggy python submission (verdict: Runtime Error):
N=int(input())
c=0
INF=2000000
x=[]
y=[]

rN=int(N**0.5)

for i in range(rN):
    if (i>1)&(i%2==1) : continue
    xi = rN - i
    for j in range(rN-i) :
        yj= rN - j
        if ((xi)*(yj))==N:
            x=xi
            y=yj
            C=1
            break
    if c==1:break


d=x+y-2
print(d)

Fixed submission:
N=int(input())
c=0
d=10000000000000
rN=int(N**0.5)

for i in range(rN):
    if (N%(i+1)==0) :
        x=i+1
        y=int(N/(i+1))
        if d>(x+y):
            d=x+y

print(d-2)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
c=0
INF=2000000
x=[]
y=[]

for i in range(N):
    if i*i>N : break
    for j in range(N-i) :
        if ((i+1)*(i+j+1))==N:
            x.append(i+1)
            y.append(i+j+1)
            c+=1


d=INF
for i in range(c):
    if d>(x[i]+y[i]):
        d=x[i]+y[i]-2

print(d)

Fixed submission:
N=int(input())
c=0
d=10000000000000
rN=int(N**0.5)

for i in range(rN):
    if (N%(i+1)==0) :
        x=i+1
        y=int(N/(i+1))
        if d>(x+y):
            d=x+y

print(d-2)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
c=0
INF=2000000
x=[0 for _ in range(INF)]
y=[0 for _ in range(INF)]

for i in range(N):
    for j in range(N) :
        if (i+1)*(j+1)==N:
            x[c]=i
            y[c]=j
            c+=1

d=INF
for i in range(c):
    if d>(x[i]+y[i]):
        d=x[i]+y[i]

print(d)

Fixed submission:
N=int(input())
c=0
d=10000000000000
rN=int(N**0.5)

for i in range(rN):
    if (N%(i+1)==0) :
        x=i+1
        y=int(N/(i+1))
        if d>(x+y):
            d=x+y

print(d-2)