Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
from collections import defaultdict

def prime_factorize(N): #素因数分解
    exponent = 0
    while N%2 == 0:
        exponent += 1
        N //= 2
    if exponent: factorization = [[2,exponent]]
    else: factorization = []
    i=1
    while i*i <=N:
        i += 2
        if N%i: continue
        exponent = 0
        while N%i == 0:
            exponent += 1
            N //= i
        factorization.append([i,exponent])
    if N!= 1: factorization.append([N,1])
    assert N != 0, "zero"
    return factorization

N = int(input())

if N <= 2:
    print(N)
else:
    num = defaultdict(int)
    for i in range(2,N+1):
        for n,m in prime_factorize(i):
            num[n] += m


ans = 1
mod = int(1e9+7)
for i in num.values():
    ans = ((i+1)*ans)%mod

print(ans)

Fixed submission:
from collections import defaultdict

def prime_factorize(N): #素因数分解
    exponent = 0
    while N%2 == 0:
        exponent += 1
        N //= 2
    if exponent: factorization = [[2,exponent]]
    else: factorization = []
    i=1
    while i*i <=N:
        i += 2
        if N%i: continue
        exponent = 0
        while N%i == 0:
            exponent += 1
            N //= i
        factorization.append([i,exponent])
    if N!= 1: factorization.append([N,1])
    assert N != 0, "zero"
    return factorization

N = int(input())

if N <= 2:
    print(N)
    exit()
else:
    num = defaultdict(int)
    for i in range(2,N+1):
        for n,m in prime_factorize(i):
            num[n] += m


ans = 1
mod = int(1e9+7)
for i in num.values():
    ans = ((i+1)*ans)%mod

print(ans)
Buggy python submission (verdict: Runtime Error):
a,b,h = map(int,input().split())

print((a+b)*h//2)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())

print((a+b)*c//2)

Buggy python submission (verdict: Runtime Error):
a,b,h = map(int,input().split())]

print((a+b)*h//2)

Fixed submission:
a = int(input())
b = int(input())
c = int(input())

print((a+b)*c//2)
Buggy python submission (verdict: Runtime Error):
R,G,B = map(int,input().split())
K = int(input())
ans = 'No'

while (K > 0):
  if R >= G:
    G *= 2
    K -= 1
  elif G >= B:
    B *= 2
    K -= 1
  else:
    k -= 1
      
if R < G < B:
  ans = 'Yes'
  
print(ans)

Fixed submission:
R,G,B = map(int,input().split())
K = int(input())
ans = 'No'

while (K > 0):
  if R >= G:
    G *= 2
    K -= 1
  elif G >= B:
    B *= 2
    K -= 1
  else:
    K -= 1
      
if R < G < B:
  ans = 'Yes'
  
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N, K = map(int,input().split())

def DIF(N):
  global K
  return abs(N-K)

if N < DIF(N):
  print(N)
else:
  if N % K == 0:
    print(0)
  else:
    while N >= DIF(N):
      N = DIF(N)
    print(N)

Fixed submission:
N, K = map(int,input().split())
print(min(N%K,K-N%K))


'''
def DIF(N):
  global K
  return abs(N-K)

if N < DIF(N):
  print(N)
else:
  if N % K == 0:
    print(0)
  else:
    while N >= DIF(N):
      N = DIF(N)
    print(N)
'''
Buggy python submission (verdict: Runtime Error):
S = list(input())
last = len(S) - 1

S_head = S[0]

S_clone = S
S_bothEnd = [S[0],S[1],S[last]]
S_center = list(set(S)-set(S_bothEnd))

S_clone.remove('A')
S_clone.remove('C')

evalLow = "".join(S_clone)

if S_head == "A" and S_center.count("C")  == 1 and evalLow.islower() == 1:
  print('AC')
else:
  print('WA')

Fixed submission:
S = list(input())
last = len(S) - 1

S_head = S[0]

S_bothEnd = [S[0],S[1],S[last]]
S_center = list(set(S)-set(S_bothEnd))

S_clone = S
if "A" in S_clone:
  S_clone.remove('A')
if "C" in S_clone:
  S_clone.remove('C')

evalLow = "".join(S_clone)

if S_head == "A" and S_center.count("C")  == 1 and evalLow.islower() == 1:
  print('AC')
else:
  print('WA')
Buggy python submission (verdict: Time Limit Exceeded):
from statistics import median
N = int(input())
A = list(map(int, input().split()))
B = list()
sad = 0

for i in range(N):
  B.append(A[i]-i)

  b = median(B)

for i in range(N):
  sad = sad + abs(A[i] - (b+i))

print(int(sad))

Fixed submission:
from statistics import median
N = int(input())
A = list(map(int, input().split()))
B = list()
sad = 0

for i in range(N):
  B.append(A[i]-i)

b = median(B)

for i in range(N):
  sad = sad + abs(A[i] - (b+i))

print(int(sad))
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys
from collections import defaultdict

def solve(N: int, S: "List[str]"):

    d = defaultdict(int)
    for s in S:
        d[s]+=1

    return '\n'.join(sorted([kv[0] for kv in d.items() if kv[1] == max(d.values())]))


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    S = [next(tokens) for _ in range(N)]  # type: "List[str]"
    print(solve(N, S))

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys
from collections import defaultdict

def solve(N: int, S: "List[str]"):
    d = defaultdict(int)
    cnt_common = 0
    commons = []

    for s in S:
        d[s] += 1
        if cnt_common < d[s]:
            cnt_common=d[s]
            commons = [s]
        elif cnt_common == d[s]:
            commons.append(s)

    return '\n'.join(sorted(commons))

# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    S = [next(tokens) for _ in range(N)]  # type: "List[str]"
    print(solve(N, S))

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys


def solve(N: int, P: "List[int]"):
    cnt = 0
    for i in range(0, N):
        flag=True
        for j in range(0, i+1):
            if P[i] > P[j]:
                flag=False
                break
        if flag:
            cnt+=1
    return cnt


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    P = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    print(solve(N, P))

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys


def solve(N: int, P: "List[int]"):
    cnt = 1
    min = P[0]
    for i in range(1, N):
        if P[i] <= min:
            cnt+=1
            min = P[i]
    return cnt


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    P = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    print(solve(N, P))

if __name__ == '__main__':
    main()

Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys


def solve(N: int, P: "List[int]"):
    cnt = 0
    for i in range(0, N):
        flag=True
        for j in range(0, i+1):
            if P[i] > P[j]:
                flag=False
        if flag:
            cnt+=1
    return cnt


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    P = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    print(solve(N, P))

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys


def solve(N: int, P: "List[int]"):
    cnt = 1
    min = P[0]
    for i in range(1, N):
        if P[i] <= min:
            cnt+=1
            min = P[i]
    return cnt


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    P = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    print(solve(N, P))

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Runtime Error):
#!/usr/bin/env python3

import math
import itertools

def distance(p1, p2):
    return math.sqrt((p1[0]-p2[0])**2 + (p1[1]-p2[1])**2)

n = input()
points = {i:input().split() for i in range(n)}

total_distance = 0

for cource in itertools.permutations(range(n)):
    for i in range(1, n):
        total_distance += distance(cource[i-1], cource[i])

print(total_distance/math.factorial(n))

Fixed submission:
import math
import itertools

def distance(p1, p2):
    return math.sqrt((p1[0]-p2[0])**2 + (p1[1]-p2[1])**2)

n = int(input())
points = {i: list(map(int,  input().split())) for i in range(n)}

total_distance = 0

for cource in itertools.permutations(range(n)):
    for i in range(1, n):
        total_distance += distance(points[cource[i-1]], points[cource[i]])

print(total_distance/math.factorial(n))
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys
import itertools


def solve(N: int, L: "List[int]"):
    cnt=0
    for s in itertools.combinations(L, 3):
        a, b, c = s
        if (a < b + c) and (b < a + c) and (c < a + b):
            cnt+=1
    return cnt


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    L = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    print(solve(N, L))

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys
import bisect


def solve(N: int, L: "List[int]"):
    L.sort()
    cnt=0
    for a_i in range(N):
        for b_i in range(a_i+1, N):
            c_r = bisect.bisect_left(L, L[a_i]+L[b_i])
            cnt += c_r - b_i - 1
    return cnt


def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    L = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    print(solve(N, L))

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):
#!/usr/bin/env python3
import sys


def solve(N: int, A: "List[int]"):
    s = sorted(list(set(A)))

    for a in A:
        if len(s) == 1:
            print(s[-1])
        elif a == s[-1] and A.count(a) == 1:
            print(s[-2])
        else:
            print(s[-1])


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)

if __name__ == '__main__':
    main()


Fixed submission:
#!/usr/bin/env python3
import sys


def solve(N: int, A: "List[int]"):
    s = sorted(list(set(A)))
    mc = A.count(s[-1])

    for a in A:
        if len(s) == 1:
            print(s[-1])
        elif a == s[-1] and mc == 1:
            print(s[-2])
        else:
            print(s[-1])


# Generated by 1.1.6 https://github.com/kyuridenamida/atcoder-tools  (tips: You use the default template now. You can remove this line by using your custom template)
def main():
    def iterate_tokens():
        for line in sys.stdin:
            for word in line.split():
                yield word
    tokens = iterate_tokens()
    N = int(next(tokens))  # type: int
    A = [int(next(tokens)) for _ in range(N)]  # type: "List[int]"
    solve(N, A)

if __name__ == '__main__':
    main()
Buggy python submission (verdict: Time Limit Exceeded):

def solve():
	n=input()
	s='7'*len(n)
	flag=1
	i=len(n)
	if(int(n)%2==0 and int(n)%5==0):
		print(-1)
		return
	while(flag):
		if(int(s)%int(n)==0):
			flag=0
		else:
			i+=1
			s='7'*i
	print(len(s))
if __name__ == "__main__":
	#code goes below
	# for _ in range(int(input())):
	solve()

Fixed submission:

def solve():
	n=int(input())
	if n%2==0 or n%5==0:
		print(-1)
		return 
	ans=1
	p=7%n
	while(p!=0):
		p=(p*10+7)%n
		ans+=1
	print(ans)
if __name__ == "__main__":
	#code goes below
	# for _ in range(int(input())):
	solve()

Buggy python submission (verdict: Time Limit Exceeded):

def solve():
	n=input()
	s='7'*len(n)
	flag=1
	i=len(n)
	if(int(n)%2==0):
		print(-1)
		return
	while(flag):
		if(int(s)%int(n)==0):
			flag=0
		else:
			i+=1
			s='7'*i
	print(len(s))
if __name__ == "__main__":
	#code goes below
	# for _ in range(int(input())):
	solve()

Fixed submission:

def solve():
	n=int(input())
	if n%2==0 or n%5==0:
		print(-1)
		return 
	ans=1
	p=7%n
	while(p!=0):
		p=(p*10+7)%n
		ans+=1
	print(ans)
if __name__ == "__main__":
	#code goes below
	# for _ in range(int(input())):
	solve()
Buggy python submission (verdict: Runtime Error):
import sys 
sys.stdin = open('input.txt', 'r')  
sys.stdout = open('output.txt', 'w') 
t=int(input())
s=set()
for i in range(t):
    # n,m=map(int,input().split())
    n=input()
    s.add(n);
print(len(s));

    

Fixed submission:
 
t=int(input())
s=set()
for i in range(t):
    # n,m=map(int,input().split())
    n=input()
    s.add(n);
print(len(s));
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
if a>=0 and b>=0 and c>=0 and d>=0:
  print(b*d)
elif a<=0 and b>=0 and c>=0 and d>=0:
  print(b*d)
elif a<=0 and b<=0 and c>=0 and d>=0:
  print(b*c)
elif a<=0 and b>=0 and c<=0 and d>=0:
  print(b*d)
elif a<=0 and b<=0 and c<=0 and d>=0:
  print(a*c)
elif a<=0 and b>=0 and c<=0 and d<=0:
  print(a*c)
elif a<=0 and b<=0 and c<=0 and d<=0:
  print(a*c)

Fixed submission:
X=int(input())
if X==0:
  print(1)
else:
  print(0)
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
if a<=0 and b<=0 and c<=0 and d<=0:
  print(a*c)
elif a>=0 and b>=0 and c>=0 and d>=0:
  print(b*d)
elif b>=0 and c<=0 d<=0:
  print(b*c)
else:
  print(a*d)

Fixed submission:
a,b,c,d=map(int,input().split())
if a<0 and b<0 and c>=0 and d>=0:
  print(b*c)
elif a<0 and b<0 and c<0 and d>=0:
  print(a*c)
elif a<0 and b>=0 and c<0 and d<0:
  print(a*c)
elif a<0 and b<0 and c<0 and d<0:
  print(a*c)
elif a<0 and b>=0 and c<0 and d>=0 and abs(a*c)>=abs(b*d):
  print(a*c)
elif a>=0 and b>=0 and c<0 and d<0:
  print(a*d)
else:
  print(b*d)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
li = list(map(int, input().split()))
c=0
ali=[]
for i in range(0,N):
  for j in range(0,N):
    for k in range(0,N):
      if li[i]+li[j]>li[k] and li[j]+li[k]>li[i] and li[k]+li[i]>li[j]:
        if li[i]!=li[j] and li[j]!=li[k] and li[k]!=li[i]:
          if i!=j and j!=k and k!=i:
            ali.append(sorted([i,j,k]))
def get_duplicate_list(seq):
    seen = []
    return [x for x in seq if not seen.append(x) and seen.count(x) == 2]
print(len(get_duplicate_list(ali)))

Fixed submission:
N=int(input())
li = list(map(int, input().split()))
c=0
ali=[]
for i in range(0,N):
  for j in range(0,N):
    for k in range(0,N):
      if li[i]+li[j]>li[k] and li[j]+li[k]>li[i] and li[k]+li[i]>li[j]:
        if li[i]!=li[j] and li[j]!=li[k] and li[k]!=li[i]:
          if i!=j and j!=k and k!=i and i<j and j<k:
            ali.append(sorted([i,j,k]))
print(len(ali))

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
li = list(map(int, input().split()))
c=0
ali=[]
for i in range(0,N):
  for j in range(0,N):
    for k in range(0,N):
      if li[i]+li[j]>li[k] and li[j]+li[k]>li[i] and li[k]+li[i]>li[j]:
        if li[i]!=li[j] and li[j]!=li[k] and li[k]!=li[i]:
          ali.append(sorted([i,j,k]))
def get_duplicate_list(seq):
    seen = []
    return [x for x in seq if not seen.append(x) and seen.count(x) == 2]
print(len(get_duplicate_list(ali)))

Fixed submission:
N=int(input())
li = list(map(int, input().split()))
c=0
ali=[]
for i in range(0,N):
  for j in range(0,N):
    for k in range(0,N):
      if li[i]+li[j]>li[k] and li[j]+li[k]>li[i] and li[k]+li[i]>li[j]:
        if li[i]!=li[j] and li[j]!=li[k] and li[k]!=li[i]:
          if i!=j and j!=k and k!=i and i<j and j<k:
            ali.append(sorted([i,j,k]))
print(len(ali))
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=N-1000*(N//1000)
B=((N//1000)+1)*1000-N
if A<=B:
  return A
else:
  return B

Fixed submission:
N=int(input())
A=1000*(N//1000)-N
B=((N//1000)+1)*1000-N
if A<=B and A>=0:
  print(int(A))
else:
  print(int(B))
Buggy python submission (verdict: Runtime Error):
A,B=map(int,input().split())
print(int((A*B)//1))

Fixed submission:
import math
A,B=input().split()
A=int(A)
B,C=B.split('.')
B=int(B)
C=int(C)
print(A*(B*100+C)//100)
Buggy python submission (verdict: Runtime Error):
S,T=map(str,input().split())
A,B=map(int,input().split())
U=str(input())
if U==S:
  A=A-1
elif U==T:
  B=B-1
print({} {}.format(A,B))

Fixed submission:
S,T=map(str,input().split())
A,B=map(int,input().split())
U=str(input())
if U==S:
  A=A-1
elif U==T:
  B=B-1
print("{} {}".format(A,B))
Buggy python submission (verdict: Runtime Error):
import collections
N=int(input())
A=list(map(int,input().split()))
li=list(collections.Counter(A).values())
for i in range(N):
  if li[i]<1:
    print('NO')
    exit()
print('YES')

Fixed submission:
import collections
N=int(input())
A=list(map(int,input().split()))
li=list(collections.Counter(A).values())
for i in range(len(li)):
  if li[i]>1:
    print('NO')
    exit()
print('YES')

Buggy python submission (verdict: Time Limit Exceeded):
import collections
N=int(input())
A=list(map(int,input().split()))
c = collections.Counter(A)
for i in range(N):
  if list(c.values())[i]>1:
    print('NO')
    exit()
print('YES')

Fixed submission:
import collections
N=int(input())
A=list(map(int,input().split()))
li=list(collections.Counter(A).values())
for i in range(len(li)):
  if li[i]>1:
    print('NO')
    exit()
print('YES')
Buggy python submission (verdict: Time Limit Exceeded):
N,K=map(int,input().split())
H=list(map(int, input().split()))
#Nモンスターの数、K必殺回数（モンスターは体力ゼロになる）、Hモンスターの数と各々の体力
H=sorted(H,reverse=True)
if K>=len(H):
  print(0)
else:
  for i in range(0,K):
    del H[0]
  result=sum(H)
  print(result)

Fixed submission:
N,K=map(int,input().split())
H=list(map(int, input().split()))
#Nモンスターの数、K必殺回数（モンスターは体力ゼロになる）、Hモンスターの数と各々の体力
H=sorted(H)
if K>=len(H):
  print(0)
else:
  for i in range(0,K):
    del H[-1]
  result=sum(H)
  print(result)
Buggy python submission (verdict: Runtime Error):
H=int(input())
def f(H):
  if H==1:
    return 1
  elif H>1:
    return 2*f(H/2)+1
print(f(H))

Fixed submission:
H=int(input())
def f(H):
  if H==1:
    return 1
  elif H>1:
    return 2*f(H//2)+1
re=0
re=f(H)
print(re)
Buggy python submission (verdict: Runtime Error):
N=int(input())
S=str(input())
S=S.remove('ABC')
if N==len(S):
  return 0
else:
  return (N-len(S))//3

Fixed submission:
N=int(input())
S=str(input())
S=S.replace('ABC','')
if N==len(S):
  print(0)
else:
  print((N-len(S))//3)
Buggy python submission (verdict: Runtime Error):
A＝int(input())
B=int(input())
C=6-A-B
print(C)

Fixed submission:
A=int(input())
B=int(input())
C=6-A-B
print(C)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
a=list(map(int, input().split()))
l = [i for i in range(1,N+1)]
c=0
for j in range(N):
  if l[0]==a[j]:
    del l[0]
  elif l[0]!=a[j]:
    c+=1
if len(l)==N:
  print(-1)
  exit()
print(c)

Fixed submission:
N=int(input())
a=list(map(int, input().split()))
S=1
c=0
for j in range(N):
  if S==a[j]:
    S+=1
  elif S!=a[j]:
    c+=1
if c==N:
  print(-1)
  exit()
print(c)

Buggy python submission (verdict: Runtime Error):
N=int(input())
a=list(map(int, input().split()))
l = [i for i in range(1,N+1)]
c=0
for i in range(N):
  for j in range(N):
    if l[0]==a[j]:
      del l[0]
      c+=1
if len(l)==N:
  print(-1)
  exit()
print(c)

Fixed submission:
N=int(input())
a=list(map(int, input().split()))
S=1
c=0
for j in range(N):
  if S==a[j]:
    S+=1
  elif S!=a[j]:
    c+=1
if c==N:
  print(-1)
  exit()
print(c)
Buggy python submission (verdict: Runtime Error):
N=int(input())
S=list(map(str, input()))
li=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','W','X','Y','Z']
answer=[]
for i in range(len(S)):
  for j in range(len(li)):
    if S[i]==li[j] and j<len(li)-N:
      answer.append(li[j+N])
    elif S[i]==li[j] and j>=len(li)-N:
      answer.append(li[j+N-len(li)])
print("".join(answer))

Fixed submission:
N=int(input())
S=list(map(str, input()))
li=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
answer=[]
for i in range(len(S)):
  for j in range(len(li)):
    if S[i]==li[j] and j<len(li)-N:
      answer.append(li[j+N])
    elif S[i]==li[j] and j>=len(li)-N:
      answer.append(li[j+N-len(li)])
print("".join(answer))

Buggy python submission (verdict: Runtime Error):
N=int(input())
S=list(map(str, input()))
li=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','W','X','Y','Z']
answer=[]
for i in range(len(S)):
  for j in range(len(li)):
    if S[i]==li[j] and j<len(li)-N:
      answer.append(li[j+N])
    elif S[i]==li[j] and j>=len(li)-N:
      answer.append(li[j+N-len(li)])
print("".join(answer))

Fixed submission:
N=int(input())
S=list(map(str, input()))
li=['A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z']
answer=[]
for i in range(len(S)):
  for j in range(len(li)):
    if S[i]==li[j] and j<len(li)-N:
      answer.append(li[j+N])
    elif S[i]==li[j] and j>=len(li)-N:
      answer.append(li[j+N-len(li)])
print("".join(answer))
Buggy python submission (verdict: Runtime Error):
print=(input()**3)

Fixed submission:
print(int(input())**3)
Buggy python submission (verdict: Runtime Error):
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
s=0
for i in range(N):
  s+=B[A[i]-1]
  if i!=0 and A[i-1]+1==A[i]:
    s+=C[i]
print(s)

Fixed submission:
N=int(input())
A=list(map(int,input().split()))
B=list(map(int,input().split()))
C=list(map(int,input().split()))
s=0
for i in range(N):
  s+=B[A[i]-1]
  if i!=0 and A[i-1]+1==A[i]:
    s+=C[A[i]-2]
print(s)
Buggy python submission (verdict: Runtime Error):
A,B,C,D=map(int,input().split())
if A<=C:
  if D<=B:
    t=B-C
  else:
    t=D-C
else:
  if D<=B:
    t=B-A
  else:
    t=D-A
  t=D-A
if t<=0:
  print(0)
else:
  print(t)

Fixed submission:
N=int(input())
if N==1:
  print('Hello World')
  exit()
else:
  A=int(input())
  B=int(input())
  print(A+B)