Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
A = list(map(int,input().split()))
print (l.index(0)+1)

Fixed submission:
l = list(map(int,input().split()))
print (l.index(0)+1)

Buggy python submission (verdict: Runtime Error):
a = list(map(int,input().split()))
print (l.index(0)+1)


Fixed submission:
l = list(map(int,input().split()))
print (l.index(0)+1)

Buggy python submission (verdict: Runtime Error):
A = list(int, input().split())
print(A.index('0') + 1)

Fixed submission:
l = list(map(int,input().split()))
print (l.index(0)+1)

Buggy python submission (verdict: Runtime Error):
A = list(int, input().split())
print(A.index(0) + 1)

Fixed submission:
l = list(map(int,input().split()))
print (l.index(0)+1)

Buggy python submission (verdict: Runtime Error):
A = list(int, input().split())

for i in A:
  if 0 == A[i]:
    print(i + 1)
   

Fixed submission:
l = list(map(int,input().split()))
print (l.index(0)+1)
Buggy python submission (verdict: Runtime Error):
X, Y = map(int, input().split())
 
ans = 'No'
if a in range(X + 1):
    b = X - a
    if 2 * a + 4 * b == Y:
        ans = 'Yes'
print(ans)

Fixed submission:
X, Y = map(int, input().split())
 
ans = 'No'
for a in range(X + 1):
    b = X - a
    if 2 * a + 4 * b == Y:
        ans = 'Yes'
print(ans)

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

ans = 'No'
if a in range(X + 1):
    b = X - a
    if 2 * a + 4 * b == Y:
        ans = 'Yes'
        print('Yes')


Fixed submission:
X, Y = map(int, input().split())
 
ans = 'No'
for a in range(X + 1):
    b = X - a
    if 2 * a + 4 * b == Y:
        ans = 'Yes'
print(ans)
Buggy python submission (verdict: Runtime Error):
A, B = input().split()

C = A * B
print(C)

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

c = a * b
print(c)
Buggy python submission (verdict: Runtime Error):
import math
a, b = input().split()
print(math.floor(a*b))

Fixed submission:
import math
A, B = map(str, input().split())
A = int(A)
B = list(B)
del B[1]
B = ''.join(B)
B_int = int(B)
print((A * B_int) // 100)

Buggy python submission (verdict: Runtime Error):
import math
A, B = map(int, input().split())
print(math.floor(A*B))

Fixed submission:
import math
A, B = map(str, input().split())
A = int(A)
B = list(B)
del B[1]
B = ''.join(B)
B_int = int(B)
print((A * B_int) // 100)
Buggy python submission (verdict: Runtime Error):
K = int(input())
S = list(input())
S2 = []

for i in range(K):
    n = S[i]
    S2.append(n)

S2.append('...')
print(''.join(S2))
    

Fixed submission:
K = int(input())
S = list(input())
S2 = []

if len(S) <= K:
    print(''.join(S))
else:
    for i in range(K):
        n = S[i]
        S2.append(n)
if len(S2) == K:
    print(''.join(S2) + '...')
Buggy python submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())

rad = 2 * math.pi * (((C / 12)+((5 / 60)*(D / 60))) - (D /60))

if math.cos(rad) == 1:
    print(abs(A - B))
elif math.cos(rad) == -1:
    print(A + B)
else:
    print(math.sqrt(A**2 + B**2 - 2*A*B*math.cos(rad)))

Fixed submission:
import math
A, B, C, D = map(int, input().split())

rad = 2 * math.pi * (((C / 12)+((5 / 60)*(D / 60))) - (D /60))

if math.cos(rad) == 1:
    print(abs(A - B))
elif math.cos(rad) == -1:
    print(A + B)
else:
    print(math.sqrt(A**2 + B**2 - 2*A*B*math.cos(rad)))

Buggy python submission (verdict: Runtime Error):
A, B, C, D = map(int, input().split())

rad = 2 * math.pi * ((C / 12) - (D / 60))
cos = math.cos(rad)

if math.cos(rad) == 1:
    print(abs(A - B))
elif math.cos(rad) == -1:
    print(A + B)
else:
    print(math.sqrt(A**2 + B**2 - 2*A*B*cos))

Fixed submission:
import math
A, B, C, D = map(int, input().split())

rad = 2 * math.pi * (((C / 12)+((5 / 60)*(D / 60))) - (D /60))

if math.cos(rad) == 1:
    print(abs(A - B))
elif math.cos(rad) == -1:
    print(A + B)
else:
    print(math.sqrt(A**2 + B**2 - 2*A*B*math.cos(rad)))
Buggy python submission (verdict: Runtime Error):
n = input()
a = list(map(int,input().split()))

for i in range(n):
  if not a[i] % 2 != 0 or (a[i] % 3 == 0 or a[i] % 5 == 0):
    print("DNIED")
    exit()
else:
  print("APPROVED")


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

if a == b and b == c:
  print("No")
elif a != b and b != c and a != c:
  print("No")
else:
  print("Yes")

Buggy python submission (verdict: Runtime Error):
a,b,c = input().split()

if a == b and b == c:
  print(No)
elif a != b and b != c and a != c:
  print(No)
else:
  print(Yes)

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

if a == b and b == c:
  print("No")
elif a != b and b != c and a != c:
  print("No")
else:
  print("Yes")

Buggy python submission (verdict: Runtime Error):
a,b,c = input().split()

if a == b == c:
  print(Yes)
else:
  print(No)


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

if a == b and b == c:
  print("No")
elif a != b and b != c and a != c:
  print("No")
else:
  print("Yes")

Buggy python submission (verdict: Runtime Error):
a,b,c = input().split()

if a == b ==c:
  print(Yes)
else:
  print(No)

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

if a == b and b == c:
  print("No")
elif a != b and b != c and a != c:
  print("No")
else:
  print("Yes")
Buggy python submission (verdict: Runtime Error):
S,T = int().split()
A,B = map(int,input().split())
U = input()

if U == S:
  A = A - 1
else:
  B = B - 1
print(A,B)



Fixed submission:
S,T = input().split()
A,B = map(int,input().split())
U = input()

if U == S:
  A = A - 1
else:
  B = B - 1
print(A,B)
Buggy python submission (verdict: Runtime Error):
n = input()
a = list(input().split())

b = set(a)

if len(a) == len(b):
  print(YES)
else:
  print(NO)


Fixed submission:
n = input()
a = list(input().split())

b = set(a)

if len(a) == len(b):
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
n = input()
a = list(input().split())

b = set(a)

if len(a) == len(b):
  print(YES)
else:
  print(NO)

Fixed submission:
n = input()
a = list(input().split())

b = set(a)

if len(a) == len(b):
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
n = input()
s = set(input().split())
if len(s) == n:
  print(YES)
else:
  print(NO)


Fixed submission:
n = input()
a = list(input().split())

b = set(a)

if len(a) == len(b):
  print("YES")
else:
  print("NO")

Buggy python submission (verdict: Runtime Error):
n = input()
s = input().split()
if len(set(s)) == n:
  print(YES)
else:
  print(NO)

Fixed submission:
n = input()
a = list(input().split())

b = set(a)

if len(a) == len(b):
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())

if M == N:
  print(Yes)
else:
  print(No)

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

if M == N:
  print("Yes")
else:
  print("No")
Buggy python submission (verdict: Runtime Error):
N = int(input())
P = list(map(int, input().split()))
Q = list(map(int, input().split()))

ans = []
l = range(1, N + 1)
import itertools


for v in itertools.permutations(l, N):
    if list(v) == P:
      a = v.index(P)
        
    if list(v) == Q:
      b = v.index(Q)  
    

print(abs(b - a))


Fixed submission:
K,X = map(int,input().split())

if 500*K >= X:
  print('Yes')
else:
  print('No')

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

if 500*K => X:
  print('Yes')
else:
  print('No')


Fixed submission:
K,X = map(int,input().split())

if 500*K >= X:
  print('Yes')
else:
  print('No')

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

if 500*K =>X:
  print('Yes')
else:
  print('No')


Fixed submission:
K,X = map(int,input().split())

if 500*K >= X:
  print('Yes')
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
import itertools
N = int(input())
P = list(map(int, input().split()))
Q = list(map(int, input().split()))

permutations = list(itertools.permutations(range(1, N+1)))
p = permutations.index(P)
q = permutations.index(Q)
print(abs(p-q))

Fixed submission:
import itertools
N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))

permutations = list(itertools.permutations(range(1, N+1)))
p = permutations.index(P)
q = permutations.index(Q)
print(abs(p-q))

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

ans = []
l = range(1, N + 1)
import itertools


for v in itertools.permutations(l, N):
    if list(v) == P:
      a = list(v).index(P)
        
    if list(v) == Q:
      b = list(v).index(Q)
    

print(abs(b - a))


Fixed submission:
import itertools
N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))

permutations = list(itertools.permutations(range(1, N+1)))
p = permutations.index(P)
q = permutations.index(Q)
print(abs(p-q))

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

ans = []
l = range(1, N + 1)
import itertools


for v in itertools.permutations(l, N):
    if list(v) == P:
      a = v.index(P)
        
    if list(v) == Q:
      b = v.index(Q)  
    

print(abs(b - a))


Fixed submission:
import itertools
N = int(input())
P = tuple(map(int, input().split()))
Q = tuple(map(int, input().split()))

permutations = list(itertools.permutations(range(1, N+1)))
p = permutations.index(P)
q = permutations.index(Q)
print(abs(p-q))
Buggy python submission (verdict: Runtime Error):
A, B = map(int(input()))
if (A+B) % 2 == 0:
  print((A+B)//2)
else:
  print('IMPOSSIBLE')

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

Buggy python submission (verdict: Runtime Error):
A, B = int(input())
if (A+B) % 2 == 0:
  print((A+B)//2)
else:
  print('IMPOSSIBLE')

Fixed submission:
A, B = map(int,input().split())
if (A+B) % 2 == 0:
    print((A+B)//2)
else:
    print('IMPOSSIBLE')
Buggy python submission (verdict: Runtime Error):
N = int(input())
S = list(map(int, input().split()))
Min_S = min(S)
Min_idx = S.index(Min_S)


S[0], S[Min_idx] = S[Min_idx], S[0]
if S == Sort_S:
    print('YES')
else:
    print('NO')

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

cnt = 0
for i in range(N):
    if i + 1 == p[i]:
        cnt += 1

if cnt >= N - 2:
    print("YES")
else:
    print("NO")

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

Max_S = max(S)
Max_idx = S.index(Max_S)
Min_S = min(S)
Min_idx = S.index(Max_S)
Sort_S = sorted(S)

S[Max_idx], S[Min_idx] = S[Min_idx], S[Max_idx]
if S == Sort_S:
    print('YES')
else:
    print('NO')


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

cnt = 0
for i in range(N):
    if i + 1 == p[i]:
        cnt += 1

if cnt >= N - 2:
    print("YES")
else:
    print("NO")
Buggy python submission (verdict: Runtime Error):
n = int(input())
L = list(map(int, input().split()))


count = 0
for i in range(n):
        if min(L[i],L[i+2]) < L[i+1] < max(L[i], L[i+2]):
            count += 1
            if i+2 == n - 1:
                break
print(count)

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


count = 0
for i in range(1,n-1):
    if min(L[i-1],L[i+1]) < L[i] < max(L[i-1], L[i+1]):
        count += 1
            
print(count)
Buggy python submission (verdict: Runtime Error):
N = int(input())
P = sorted(list(map(int, input().split())))

print(L[N//2]-L[N//2-1])

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

print(P[N//2]-P[N//2-1])

Buggy python submission (verdict: Runtime Error):
N = int(input())
P = list(map(int, input().split()))
 
print(L[N//2]-L[N//2-1])


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

print(P[N//2]-P[N//2-1])

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

L[N//2]-L[N//2-1]

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

print(P[N//2]-P[N//2-1])
Buggy python submission (verdict: Runtime Error):
import numpy as np
import fractions
 
A,B,C,D = map(int,input().split())
BA = np.arange(A, B+1)
BA_C = BA % C
BA_D = BA % D
BA_CD = BA % (C * D//fractions.gcd(C, D))
 
C_count = np.count_nonzero(BA_C == 0)
D_count = np.count_nonzero(BA_D == 0)
CD_count = np.count_nonzero(BA_CD == 0)
 
print(len(BA)-(C_count+D_count-CD_count))

Fixed submission:
from fractions import gcd

A, B, C, D = map(int, input().split())
l = C * D // gcd(C, D)
x = (A - 1) - (A - 1) // C - (A - 1) // D + (A - 1) // l
y = B - B // C - B // D + B // l
print(y - x)

Buggy python submission (verdict: Runtime Error):
import numpy as np
import math

A,B,C,D = map(int,input().split())
BA = np.arange(A, B+1)
BA_C = BA % C
BA_D = BA % D
BA_CD = BA % (C * D//math.gcd(C, D))

C_count = np.count_nonzero(BA_C == 0)
D_count = np.count_nonzero(BA_D == 0)
CD_count = np.count_nonzero(BA_CD == 0)

print(len(BA)-(C_count+D_count-CD_count))

Fixed submission:
from fractions import gcd

A, B, C, D = map(int, input().split())
l = C * D // gcd(C, D)
x = (A - 1) - (A - 1) // C - (A - 1) // D + (A - 1) // l
y = B - B // C - B // D + B // l
print(y - x)

Buggy python submission (verdict: Runtime Error):
import numpy as np
import math

A, B, C, D = map(int, input().split())

BA = np.arange(A, B+1)
BA_C = BA % C
BA_D = BA % D
BA_CD = BA % (C * D//math.gcd(C, D))

C_count = np.count_nonzero(BA_C == 0)
D_count = np.count_nonzero(BA_D == 0)
CD_count = np.count_nonzero(BA_CD == 0)

print(len(BA)-(C_count+D_count-CD_count))

Fixed submission:
from fractions import gcd

A, B, C, D = map(int, input().split())
l = C * D // gcd(C, D)
x = (A - 1) - (A - 1) // C - (A - 1) // D + (A - 1) // l
y = B - B // C - B // D + B // l
print(y - x)
Buggy python submission (verdict: Runtime Error):
N = int(input())
*W, = map(int, input().split())

s1, s2 = 0, sum[W]
ans = sum[W]

for i in range(N):
  s1 += W[i]
  s2 -= W[i]
  ans = min(ans, abs(s1 - s2))
print(ans)

Fixed submission:
N = int(input())
*W, = map(int, input().split())
 
s1, s2 = 0, sum(W)
ans = sum(W)
 
for i in range(N):
  s1 += W[i]
  s2 -= W[i]
  ans = min(ans, abs(s1 - s2))
print(ans)
Buggy python submission (verdict: Runtime Error):
my_list = []
for i in range(1,N+1):
    l = list((input().split()))
    l.append(i)
    my_list.append(l)

my_list2 = sorted(my_list, key=lambda x:(x[0],-int(x[1])))
for i in my_list2:
  print(i[2])



Fixed submission:
N = int(input())
my_list = []
for i in range(1,N+1):
    l = list((input().split()))
    l.append(i)
    my_list.append(l)
 
my_list2 = sorted(my_list, key=lambda x:(x[0],-int(x[1])))
for i in my_list2:
  print(i[2])
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
s2 = []
for _ in range(M):
    s = list(map(int, input().split()))
    del s[0]
    s2.append(s)
p = list(map(int, input().split()))
 
ans = 0
for i in range(2**N):
    judge = True
    for g in range(len(s2)):
        for j in range(M-1):
            count = 0
            s3 = s2[g][j]
            if i >> (s3-1) & 1:
                count += 1
            if count % 2 != p[g]:
                judge = False
    if judge:
        ans += 1
print(ans)

Fixed submission:
n,m = map(int,input().split())
res = 0

q = []
for i in range(m):
    q.append(list(map(int,input().split())))
p = list(map(int,input().split()))


for s in range(2**n): 
    judge = True
    for i in range(m):
        cnt = 0
        for j in range(1,len(q[i])):
            w = q[i][j]
            if s >> (w-1) & 1:
                cnt += 1
        if cnt % 2 != p[i]:
            judge = False
    if judge:
        res += 1
print(res)

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
s2 = []
for _ in range(M):
    s = list(map(int, input().split()))
    del s[0]
    s2.append(s)
p = list(map(int, input().split()))

ans = 0
for i in range(2**N):
    judge = True
    for g in range(len(s2)):
        for j in range(M-1):
            count = 0
            s3 = s2[g][j]
            if i >> (s3-1) & 1:
                count += 1
            if count % 2 != p[g]:
                judge = False
    if judge:
        ans += 1
print(ans)

Fixed submission:
n,m = map(int,input().split())
res = 0

q = []
for i in range(m):
    q.append(list(map(int,input().split())))
p = list(map(int,input().split()))


for s in range(2**n): 
    judge = True
    for i in range(m):
        cnt = 0
        for j in range(1,len(q[i])):
            w = q[i][j]
            if s >> (w-1) & 1:
                cnt += 1
        if cnt % 2 != p[i]:
            judge = False
    if judge:
        res += 1
print(res)
Buggy python submission (verdict: Runtime Error):
A,B,C = list(map(int,input().split()))

if 


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

if sorted(ABC) == [5,5,7]:
  print("YES")
else:
  print("NO")
Buggy python submission (verdict: Runtime Error):
S=input()
T=input()

cnt=0
ans=0

b=[0]*len(S)
a=[0]*len(S)
for i in range(len(S)):
    cnt = 0
    for j in range(len(T)):
        cnt = 0
        #print(S[i],T[j])
        if S[i]==T[j]:
            cnt+=1
            if j != len(T):
                for k in range(j+1,len(T)-j-2):
                    if S[i+k]==T[j+k]:
                        cnt+=1
                    else:
                        b[i]=cnt
                        break
            b[i]=cnt
            a[i]=j

for i in range(len(a)):
    if a[i]==a.index(a[i]):
        c = a.index(a[i])
        ans = b[c]
        break
        
print(len(T)-ans)

Fixed submission:
S=input()
T=input()
cnt=0
ans=len(T)
 
for i in range(len(S)-len(T)+1):
    cnt=0
    for j in range(len(T)):
        if S[i+j]!=T[j]:
            cnt+=1
    ans=min(ans,cnt)
        
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int, input().split()))
MOD=7+10**9
ans=0
for i in range(len(A)-1):
    for j in range(i+1,len(A)):
        ai= A[i] % MOD
        aj= A[j] % MOD
        ans = ans +ai*aj % MOD
print(ans%MOD)

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

MOD=7+10**9
SUM=sum(A)
ans=0

for i in range(N-1):
    SUM-=A[i]
    ans += A[i]*SUM %MOD
print(ans %MOD)

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int, input().split()))
MOD=7+10**9
ans=0
for i in range(N-1):
    for j in range(i+1,N):
        c = A[i]*A[j] % MOD
        ans += c
print(ans%MOD)

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

MOD=7+10**9
SUM=sum(A)
ans=0

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

ans=0
for i in range(0,N+1,2):
    print(a[i])
    if a[i]%2!=0:
        ans+=1
        
print(ans)

Fixed submission:
N=int(input())
a=list(map(int,input().split()))
 
ans=0
for i in range(0,N,2):
    if a[i]%2!=0:
        ans+=1
        
print(ans)

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

ans=0
for i in range(N):
    if i%2!=0 and a[i]%2!=0:
        ans+=1
        
print(ans)

Fixed submission:
N=int(input())
a=list(map(int,input().split()))
 
ans=0
for i in range(0,N,2):
    if a[i]%2!=0:
        ans+=1
        
print(ans)
Buggy python submission (verdict: Runtime Error):
X,Y = map(int, input().split())


#つるをi

for i in range(X):
  if 2*i ==  4*X - Y and i != 0:
      ans +=1
  elif 2*(i+1) == Y:
      ans +=1
  elif 4*(X-i) == Y:
      ans +=1


if ans > 0:
  print('Yes') 
else:
  print('No')

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

ans = 0

#つるをi

for i in range(Y):
  for j in range(Y):
      if 2*i + 4*j == Y and i + j == X:
          ans +=1
        
    
if ans > 0:
  print('Yes') 
else:
  print('No')
Buggy python submission (verdict: Runtime Error):
A,B,H,M=map(int, input().split())

angle = abs(30*H-5.5*M)
angle = min(angle, 360-angle)*math.pi/180

c=A**2 + B**2 -2*A*B* math.cos(angle)
c=c**0.5

print(c)

Fixed submission:
A,B,H,M=map(int, input().split())
import math

angle = abs(30*H-5.5*M)
angle = min(angle, 360-angle)*math.pi/180
 
c=A**2 + B**2 -2*A*B* math.cos(angle)
c=c**0.5
 
print(c)
Buggy python submission (verdict: Runtime Error):
S, T = input().split()
print("Yes" if "S" == "T[:-2]" else "No")

Fixed submission:
S = input()
T = input()
print("Yes" if S == T[:-1] else "No")

Buggy python submission (verdict: Runtime Error):
S, T = input().split()
print("Yes" if S == T[:-1] else "No")


Fixed submission:
S = input()
T = input()
print("Yes" if S == T[:-1] else "No")

Buggy python submission (verdict: Runtime Error):
S, T = input().split()
print("Yes" if S == T[:-2] else "No")

Fixed submission:
S = input()
T = input()
print("Yes" if S == T[:-1] else "No")
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
A=list(map(int, input().split()))

cnt=0
for i in range(1,N+1):
    for j in range(len(A)):
        if i == A[j]:
            cnt+=1
    print(cnt)
    cnt=0

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

B=[0]*N

cnt=0
for i in range(len(A)):
    B[A[i]-1]+=1

for i in range(N):
    print(B[i])
Buggy python submission (verdict: Time Limit Exceeded):
K=int(input())
ans=0

import math

for i in range(1,K+1):
    for j in range(1,K+1):
        for k in range(1,K+1):
            ans += math.gcd(i,math.gcd(j,k))

print(ans)

Fixed submission:
K=int(input())
ans=0
 
import math
 
for i in range(1,K+1):
  for j in range(1,K+1):
    x = math.gcd(i,j)
    for k in range(1,K+1):
      ans += math.gcd(x,k)

print(ans)
Buggy python submission (verdict: Runtime Error):
x, y, z = map(int, input()split())
print(z, x, y)

Fixed submission:
x, y, z = map(int, input().split())
print(z, x, y)
Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
l=[input() for _ in range(N)]

l= sorted(l)
#print(l)

import collections
c = collections.Counter(l)
#print(c.most_common())

ans =[]

for i in range(len(c.most_common())):
    if c.most_common()[i][1] == c.most_common()[0][1]:
        print(c.most_common()[i][0])


Fixed submission:
N=int(input())
l=[input() for _ in range(N)]

l= sorted(l)

import collections
c = collections.Counter(l)
d = c.most_common()

for i in range(len(d)):
    if d[i][1] == d[0][1]:
        print(d[i][0])

Buggy python submission (verdict: Time Limit Exceeded):
N=int(input())
l=[input() for _ in range(N)]

import collections
c = collections.Counter(l)

ans =[]

for i in range(len(c.most_common())):
    if c.most_common()[i][1] == c.most_common()[0][1]:
        ans.append(c.most_common()[i][0])

ans= sorted(ans)
for i in range(len(ans)):
    print(ans[i])

Fixed submission:
N=int(input())
l=[input() for _ in range(N)]

l= sorted(l)

import collections
c = collections.Counter(l)
d = c.most_common()

for i in range(len(d)):
    if d[i][1] == d[0][1]:
        print(d[i][0])
Buggy python submission (verdict: Runtime Error):
N=int(input())
P=list(map(int, input().split()))

cnt=1

if N==1:
    print(1)
elif N==2:
    if P[1] < P[0]:
        print(2)
    else:
        print(1)
else:
    tmp = P[i-2]
    for i in range(2,N):
        if P[i] < min(P[i-1],tmp):
            tmp = min(P[i-1],tmp)
            cnt+=1
    print(cnt)

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

cnt=1

if N==1:
    print(1)
elif N==2:
    if P[1] < P[0]:
        print(2)
    else:
        print(1)
else:
    tmp = P[0]
    if P[1] <= P[0]:
        cnt +=1
    for i in range(2,N):
        tmp = min(P[i-1],tmp)
        if P[i] <= tmp:
            cnt+=1
    print(cnt)

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

cnt=1
for i in range(1,N):
    if P[i] < min(P[0:i]):
        cnt+=1
        
print(cnt)

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

cnt=1

if N==1:
    print(1)
elif N==2:
    if P[1] < P[0]:
        print(2)
    else:
        print(1)
else:
    tmp = P[0]
    if P[1] <= P[0]:
        cnt +=1
    for i in range(2,N):
        tmp = min(P[i-1],tmp)
        if P[i] <= tmp:
            cnt+=1
    print(cnt)
Buggy python submission (verdict: Runtime Error):
S, T = int.split()
print(T + S)

Fixed submission:
S, T = input().split()
print(T + S)