Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
a = int(raw_input())
b = int(raw_input())

if a<=8 and b<=8:
    print "Yay!"
else:
    print ":("


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

if a<=8 and b<=8:
    print "Yay!"
else:
    print ":("

Buggy python submission (verdict: Runtime Error):
a = int(raw_input())
b = int(raw_input())

if a<=8 and b<=8:
    print "Yay!"
else:
    print ":("

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

if a<=8 and b<=8:
    print "Yay!"
else:
    print ":("

Buggy python submission (verdict: Runtime Error):
a = int(raw_input())
b = int(raw_input())

if a<=8 and b<=8:
    print "Yay!"
else:
    print ":("

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

if a<=8 and b<=8:
    print "Yay!"
else:
    print ":("
Buggy python submission (verdict: Runtime Error):
n = int(input())
m = int(input())
a = [list(map(int, input().split())) for i in range(0,n)]
result = [0 for i in range(m)]

for mindex in range(0,m):
    for nindex in range(0,n):
        for kindex in range(1,a[nindex][0]+1):
            if a[nindex][kindex] == mindex+1:
                result[mindex]+=1
            else:
                pass
                

print(result.count(n+1))

Fixed submission:
n, m = map(int, input().split())
a = [list(map(int, input().split())) for i in range(n)]
result = [0 for i in range(m)]
for mindex in range(0,m):
    for nindex in range(0,n):
        for kindex in range(1,a[nindex][0]+1):
            if a[nindex][kindex] == mindex+1:
                result[mindex]+=1
            else:
                pass
                
 
print(result.count(n))
Buggy python submission (verdict: Runtime Error):
result = [0 for i in range(0,len(al)**2)]
for i in range(len(al)):
    for j in range(len(al)):
        result = abs(i-j)
print(min(result))

Fixed submission:
import fractions
from functools import reduce

N = int(input())
al = list(map(int, input().split()))

print(reduce(fractions.gcd, al))

Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

N = int(input())
al =  list(map(int, input().split()))



reduce(math.gcd, al)



Fixed submission:
import fractions
from functools import reduce

N = int(input())
al = list(map(int, input().split()))

print(reduce(fractions.gcd, al))
Buggy python submission (verdict: Runtime Error):
n = list(map(int, input().split()))
print(n[0]*n[1})

Fixed submission:
n = list(map(int, input().split()))
print((n[0]-1)*(n[1]-1))
Buggy python submission (verdict: Runtime Error):
R = input()
if R < 1200:
    print("ABC")
elif R<2800:
    print("ARC")
else:
    print("AGC")

Fixed submission:
R = int(input())
if R < 1200:
    print("ABC")
elif R < 2800:
    print("ARC")
else:
    print("AGC")
Buggy python submission (verdict: Runtime Error):
n=input()
if n %2==0:
    print(n)
else:
    print(2*n)

Fixed submission:
N=int(input())
if N %2==0:
    print(N)
else:
    print(N*2)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())

if a*b%2 == 0:
    print('Even')
else:
    print('Odd')

Fixed submission:
a, b = map(int, input().split())
if a*b%2 == 0:
    print('Even')
else:
    print('Odd')
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 16 21:12:07 2019

@author: yff20
"""

l1 = input().split()

ln = [0] * (int(l1[1])-1)

for num in range(0, int(l1[0])):
   l2 = input().split()
   for index in range(1, len(l2)):
       ln[int(l2[int(index)])-1] += 1
    
count = 0

for i in ln:
    if(i==int(l1[0])):
        count += 1

print(count)


Fixed submission:
# -*- coding: utf-8 -*-
"""
Created on Sat Feb 16 21:12:07 2019

@author: yff20
"""

l1 = input().split()

ln = [0] * (int(l1[1]))

for num in range(0, int(l1[0])):
   l2 = input().split()
   for index in range(1, len(l2)):
       ln[int(l2[int(index)])-1] += 1
    
count = 0

for i in ln:
    if(i==int(l1[0])):
        count += 1

print(count)
Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())

if(a > 8 or b > 8):
    print (':(') 
else:
    print ('Yay!')


Fixed submission:
l = input().split()
a = int(l[0])
b = int(l[1])

if(a > 8 or b > 8):
    print (':(') 
else:
    print ('Yay!')

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())

if(a > 8 or b > 8):
    print (':(') 
else:
    print ('Yay!')


Fixed submission:
l = input().split()
a = int(l[0])
b = int(l[1])

if(a > 8 or b > 8):
    print (':(') 
else:
    print ('Yay!')

Buggy python submission (verdict: Runtime Error):
a = int(input())
b = int(input())

if(a > 8 or b > 8):
    print (':(') 
else:
    print ('Yay!')


Fixed submission:
l = input().split()
a = int(l[0])
b = int(l[1])

if(a > 8 or b > 8):
    print (':(') 
else:
    print ('Yay!')

Buggy python submission (verdict: Runtime Error):
a = input()
b = input()

if(a > 8 || b > 8):
    print(':(')
else:
    print('Yay!')


Fixed submission:
l = input().split()
a = int(l[0])
b = int(l[1])

if(a > 8 or b > 8):
    print (':(') 
else:
    print ('Yay!')
Buggy python submission (verdict: Runtime Error):
pink = 0
green = 0
white = 0
yellow = 0

n = input()
l = raw_input().split()
 
for i in range(n):
   
    if(l[i] == 'P'):
        pink = 1

    if(l[i]== 'G'):
        green = 1

    if(l[i] == 'W'):
        white = 1

    if(l[i] == 'Y'):
        yellow = 1

if(pink + white + green + yellow) == 4:
    print u"Four"
else:
    print u"Three"


Fixed submission:
n = 0

n = input()

ans = 0

ans = n/3

print(ans)

Buggy python submission (verdict: Runtime Error):
pink = 0
green = 0
white = 0
yellow = 0

n = input()
l = raw_input().split()
 
for i in range(n):
   
    if(l[i] == 'P'):
        pink = 1

    if(l[i]== 'G'):
        green = 1

    if(l[i] == 'W'):
        white = 1

    if(l[i] == 'Y'):
        yellow = 1

if(pink + white + green + yellow) == 4:
    print('Four')
else:
    print('Three')


Fixed submission:
n = 0

n = input()

ans = 0

ans = n/3

print(ans)

Buggy python submission (verdict: Runtime Error):
pink = 0
green = 0
white = 0
yellow = 0

n = input()
l = raw_input().split()
 
for i in range(n):
   
    if(l[i] == 'P'):
        pink = 1

    if(l[i]== 'G'):
        green = 1

    if(l[i] == 'W'):
        white = 1

    if(l[i] == 'Y'):
        yellow = 1

if(pink + white + green + yellow) == 4:
    print('Four')

if(pink + white + green + yellow) == 3:
    print('Three')


Fixed submission:
n = 0

n = input()

ans = 0

ans = n/3

print(ans)
Buggy python submission (verdict: Runtime Error):
# -*- coding: utf-8 -*-

N, K = map(int, input().split())

if(N = 0):
    min = 0
    
elif(N >= K):
    min = N % K

else:
    min = 1

print(abs(min))

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

if N % K == 0:
  print(0)
  
else:
  print(1)
Buggy python submission (verdict: Runtime Error):
A, B = map(int,input().split())
if B % A == 0:
  print(A+B)
 else:
  print(B-A)
    

Fixed submission:
A, B = list(map(int,input().split()))
if B % A == 0:
  print(A+B)
else:
  print(B-A)
Buggy python submission (verdict: Time Limit Exceeded):
def count(s):
    if "W" not in s or not s:
        return 0
    w_idx = s.index("W")
    return w_idx + count(s[:w_idx] + s[w_idx + 1:])
s = list(input())
print(count(s))


Fixed submission:
s = list(input())

cnt = 0
prev_cnt = 0
result = 0
for i in range(len(s)):
    if s[i] == "B":
        cnt += 1
    if s[i] == "W":
        cnt += prev_cnt
        result += cnt
        prev_cnt = cnt
        cnt = 0
print(result)
Buggy python submission (verdict: Time Limit Exceeded):
from functools import reduce
N = int(input())
A = list(map(int, input().split()))

for i in range(N):
    l = list(A)
    l.pop(i)
    answer = 0
    for j in range(len(l)-1):
        answer += abs(l[j]-l[j+1])
    else:
        answer += abs(l[0])+abs(l[-1])
    print(answer)
    


Fixed submission:
N = int(input())
A = [0]+list(map(int, input().split()))+[0]

sum = 0
for j in range(len(A)-1):
    sum += abs(A[j]-A[j+1])
for i in range(N):
    print(sum - abs(A[i] - A[i+1]) - abs(A[i+1] - A[i+2]) + abs(A[i] - A[i+2]))
Buggy python submission (verdict: Runtime Error):
def dfs(v):
    visited[v] = True
    for v2 in range(N):
        if graph[v][v2] == False:
            continue
        if visited[v2] == True:
            continue
        dfs(v2)

global N, M, graph, visited
N, M = [int(i) for i in input().split()]
graph = [[False for _ in range(50)] for _ in range(50)]
visited = [False for _ in range(50)] 
a = [0 for _ in range(50)]
b = [0 for _ in range(50)]
for i in range(N):
    a[i], b[i] = [int(i) for i in input().split()]
    a[i] -= 1
    b[i] -= 1
    graph[a[i]][b[i]] = graph[b[i]][a[i]] = True
    
ans = 0
for i in range(M):
    graph[a[i]][b[i]] = graph[b[i]][a[i]] = False
    for j in range(N):
        visited[j] = False
    dfs(0)

    bridge = False
    for j in range(N):
        if visited[j] == False:
            bridge = True
    if bridge:
        ans += 1
    graph[a[i]][b[i]] = graph[b[i]][a[i]] = True
print(ans)


Fixed submission:
def dfs(v):
    visited[v] = True
    for v2 in range(N):
        if graph[v][v2] == False:
            continue
        if visited[v2] == True:
            continue
        dfs(v2)

global N, M, graph, visited
N, M = [int(i) for i in input().split()]
graph = [[False for _ in range(50)] for _ in range(50)]
visited = [False for _ in range(50)] 
a = [0 for _ in range(50)]
b = [0 for _ in range(50)]
for i in range(M):
    a[i], b[i] = [int(i) for i in input().split()]
    a[i] -= 1
    b[i] -= 1
    graph[a[i]][b[i]] = graph[b[i]][a[i]] = True
    
ans = 0
for i in range(M):
    graph[a[i]][b[i]] = graph[b[i]][a[i]] = False
    for j in range(N):
        visited[j] = False
    dfs(0)

    bridge = False
    for j in range(N):
        if visited[j] == False:
            bridge = True
    if bridge:
        ans += 1
    graph[a[i]][b[i]] = graph[b[i]][a[i]] = True
print(ans)
Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
road = [0] * N

for _ in range(N):
    a, b = [int(i) for i in input().split()]
    road[a - 1] += 1
    road[b - 1] += 1
for r in road:
    print(r)


Fixed submission:
N, M = map(int, input().split())
road = [0] * N

for _ in range(M):
    a, b = [int(i) for i in input().split()]
    road[a - 1] += 1
    road[b - 1] += 1
for r in road:
    print(r)

Buggy python submission (verdict: Runtime Error):
N, M = map(int, input().split())
road = [0 for _ in range(N)]

for _ in range(N):
    a, b = [int(i) for i in input().split()]
    road[a - 1] += 1
    road[b - 1] += 1
for r in road:
    print(r)


Fixed submission:
N, M = map(int, input().split())
road = [0] * N

for _ in range(M):
    a, b = [int(i) for i in input().split()]
    road[a - 1] += 1
    road[b - 1] += 1
for r in road:
    print(r)
Buggy python submission (verdict: Runtime Error):
in = [int(i) for i in input().split()]
print(max(in[0] * in[1], in[2] * in[3]]))

Fixed submission:
a,b,c,d= [int(i) for i in input().split()]
print(max(a * b, c * d))

Buggy python submission (verdict: Runtime Error):
in = [int(i) for i in input()]
print(max(in[0] * in[1], in[2] * in[3]]))

Fixed submission:
a,b,c,d= [int(i) for i in input().split()]
print(max(a * b, c * d))
Buggy python submission (verdict: Runtime Error):
N = int(input())
a = [int(i) for i in input().split()]
print(sum([min(a[l:r + 1]) for l in range(N) for r in range(l, N)]))

Fixed submission:
string = input()
stack = []
for s in string:
    if s == "T" and stack and stack[-1] == "S":
        stack.pop()
    else:
        stack.append(s)
print(len("".join(stack)))

Buggy python submission (verdict: Runtime Error):
X = input()
n = 10 ** 10000
def STring(X, n):
  index = X.find("ST")
  if index == -1 or n == 0:
    return X
  else:
    return STring(X[0:index] + X[index + 2:], n - 1)

print(len(STring(X , n)))

Fixed submission:
string = input()
stack = []
for s in string:
    if s == "T" and stack and stack[-1] == "S":
        stack.pop()
    else:
        stack.append(s)
print(len("".join(stack)))

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

def STring(X):
  index = X.find("ST")
  if index == -1:
    return X
  else:
    return STring(X[0:index] + X[index + 2:])

print(len(STring(X)))


Fixed submission:
string = input()
stack = []
for s in string:
    if s == "T" and stack and stack[-1] == "S":
        stack.pop()
    else:
        stack.append(s)
print(len("".join(stack)))
Buggy python submission (verdict: Runtime Error):
N = int(input().split()[0])
words = [input() for i in range(N)]
print("".join(words.sort()))

Fixed submission:
N = int(input().split()[0])
words = [input().strip() for i in range(N)]
print("".join(sorted(words)))

Buggy python submission (verdict: Runtime Error):
N = input().split()[0]
words = [input() for i in range(N)]
print("".join(words.sort()))

Fixed submission:
N = int(input().split()[0])
words = [input().strip() for i in range(N)]
print("".join(sorted(words)))
Buggy python submission (verdict: Runtime Error):
import math
from functools import reduce

def gcd(*numbers):
    return reduce(math.gcd, numbers)

def gcd_list(numbers):
    return reduce(math.gcd, numbers)

N = int(input())
A = [int(_) for _ in input().split()]

print(gcd_list(A))

Fixed submission:
import fractions
from functools import reduce

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

N = int(input())
A = [int(_) for _ in input().split()]

print(gcd_list(A))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(_) for _ in input().split()]
A = list(set(A))
A.sort(reverse=True)

result = 0
while True:
    if len(A) == 1:
        break
    if A[-1] == 1:
        result = 1
        break
    A[0] = A[0] % A[1]
    if A[0] == 0:
        A.pop(0)
    A = list(set(A))
    A.sort(reverse=True)

if result != 0:
    print(result)
else:
    print(A[0])


Fixed submission:
import fractions
from functools import reduce

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

N = int(input())
A = [int(_) for _ in input().split()]

print(gcd_list(A))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(_) for _ in input().split()]

A = list(set(A))
A.sort(reverse=True)

while True:
    if len(A) == 1:
        break
    A[0] = A[0] % A[1]
    if A[0] == 0:
        A.pop(0)
    A = list(set(A))
    A.sort(reverse=True)

print(A[0])


Fixed submission:
import fractions
from functools import reduce

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

N = int(input())
A = [int(_) for _ in input().split()]

print(gcd_list(A))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(_) for _ in input().split()]

A.sort(reverse=True)

while True:
    if len(A) == 1:
        break
    A[0] = A[0] % A[1]
    if A[0] == 0:
        A.pop(0)
    A.sort(reverse=True)

print(A[0])


Fixed submission:
import fractions
from functools import reduce

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

N = int(input())
A = [int(_) for _ in input().split()]

print(gcd_list(A))

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = [int(_) for _ in input().split()]

A.sort(reverse=True)

while True:
    if A.count(0) == N-1:
        break
    A[0] = A[0] % A[1]
    A.sort(reverse=True)

print(max(A))


Fixed submission:
import fractions
from functools import reduce

def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)

N = int(input())
A = [int(_) for _ in input().split()]

print(gcd_list(A))
Buggy python submission (verdict: Runtime Error):
h, w = [int(i) for i in input().split()]
s = [list(input()) for _ in range(h)]
flg = True

for i in range(1, h - 1):
    for j in range(1, j - 1):
        if s[i][j] == "#" and s[i - 1][j] == "." and s[i + 1][j] == "." and s[i][j - 1] == "." and s[i][j + 1] == ".":
            flg = False

print('Yes' if flg else 'No')

Fixed submission:
h, w = [int(i) for i in input().split()]
s = [list(input()) for _ in range(h)]
flg = True

for i in range(1, h - 1):
    for j in range(1, w - 1):
        if s[i][j] == "#" and s[i - 1][j] == "." and s[i + 1][j] == "." and s[i][j - 1] == "." and s[i][j + 1] == ".":
            flg = False

print('Yes' if flg else 'No')
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
ans = 0
for i in range(N+1):
    nums = list(str(i))
    cnt_3 = 0
    cnt_5 = 0
    cnt_7 = 0
    can_answer = True
    for j in range(len(nums)):
        if nums[j] == '3':
            cnt_3 += 1
        elif nums[j] == '5':
            cnt_5 += 1
        elif nums[j] == '7':
            cnt_7 += 1
        else:
            can_answer = False

    if can_answer and cnt_3 > 0 and cnt_5 > 0 and cnt_7 > 0:
        ans += 1
print(ans)


Fixed submission:
N = int(input())


def dfs(s):
    if int(s) > N:
        return 0
    if s == '0':
        s = ''
    ret = 0
    if all(s.count(c) > 0 for c in '753'):
        ret += 1
    for c in '753':
        ret += dfs(c + s)
    return ret


print(dfs('0'))
Buggy python submission (verdict: Time Limit Exceeded):
S = input()
strs = list(S)

m = {}
l_s = len(strs)

for i in range(l_s+1):
    m[i] = {}
    for j in range(4):
        m[i][j] = 0

m[l_s][3] = 1

for i in range(l_s)[::-1]:
    s = strs[i]
    for j in range(4):
        m[i][j] = m[i+1][j]
    if s == 'A':
        m[i][0] += m[i+1][1]
    elif s == 'B':
        m[i][1] += m[i+1][2]
    elif s == 'C':
        m[i][2] += m[i+1][3]
    else:
        m[i][0] = m[i+1][0] * 3 + m[i+1][1]
        m[i][1] = m[i+1][1] * 3 + m[i+1][2]
        m[i][2] = m[i+1][2] * 3 + m[i+1][3]
        m[i][3] *= 3
mod = 10**9+7
print(m[0][0] % mod)


Fixed submission:
S = input()
strs = list(S)

m = {}
l_s = len(strs)

for i in range(l_s+1):
    m[i] = {}
    for j in range(4):
        m[i][j] = 0

m[l_s][3] = 1

mod = 10**9+7
for i in range(l_s)[::-1]:
    s = strs[i]
    for j in range(4):
        m[i][j] = m[i+1][j]
    if s == 'A':
        m[i][0] += m[i+1][1]
    elif s == 'B':
        m[i][1] += m[i+1][2]
    elif s == 'C':
        m[i][2] += m[i+1][3]
    else:
        m[i][0] = m[i+1][0] * 3 + m[i+1][1]
        m[i][1] = m[i+1][1] * 3 + m[i+1][2]
        m[i][2] = m[i+1][2] * 3 + m[i+1][3]
        m[i][3] *= 3
    for j in range(4):
        m[i][j] = m[i][j] % mod
print(m[0][0] % mod)
Buggy python submission (verdict: Runtime Error):
# 最大公約数
def gcd(m, n):
    while(n != 0):
        temp = n
        n = m % n
        m = temp
    return m


N = int(input())
T = [int(input()) for _ in range(N)]
ans = 0
for i in range(len(T)):
    if ans == 0:
        ans = T[i]
    else:
        ans = int(ans / gcd(ans, T[i])) * T[i]
print(ans)


Fixed submission:
# 最大公約数
def gcd(m, n):
    while(n != 0):
        temp = n
        n = m % n
        m = temp
    return m


N = int(input())
T = [int(input()) for _ in range(N)]
ans = 0
for i in range(len(T)):
    if ans == 0:
        ans = T[i]
    else:
        ans = ans // gcd(ans, T[i]) * T[i]
print(ans)

Buggy python submission (verdict: Runtime Error):
# 最大公約数
def gcd(m, n):
    while(n != 0):
        temp = n
        n = m % n
        m = temp
    return m


N = int(input())
T = [int(input()) for _ in range(N)]
ans = 0
for i in range(len(T)):
    if ans == 0:
        ans = T[i]
    else:
        ans = int((ans * T[i]) / gcd(ans, T[i]))
print(ans)


Fixed submission:
# 最大公約数
def gcd(m, n):
    while(n != 0):
        temp = n
        n = m % n
        m = temp
    return m


N = int(input())
T = [int(input()) for _ in range(N)]
ans = 0
for i in range(len(T)):
    if ans == 0:
        ans = T[i]
    else:
        ans = ans // gcd(ans, T[i]) * T[i]
print(ans)

Buggy python submission (verdict: Runtime Error):
# 最大公約数
def gcd(m, n):
    temp = 0
    while(m % n != 0):
        temp = n
        n = m % n
        m = temp
    return n


N = int(input())
T = [int(input()) for _ in range(N)]
ans = 0
for i in range(len(T)):
    if ans == 0:
        ans = T[i]
    else:
        ans = int((ans * T[i]) / gcd(ans, T[i]))
print(ans)


Fixed submission:
# 最大公約数
def gcd(m, n):
    while(n != 0):
        temp = n
        n = m % n
        m = temp
    return m


N = int(input())
T = [int(input()) for _ in range(N)]
ans = 0
for i in range(len(T)):
    if ans == 0:
        ans = T[i]
    else:
        ans = ans // gcd(ans, T[i]) * T[i]
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
A = list(map(int, input().split()))
b = []
for i in range(len(A)):
    if i % 2 == 0:
        b.append(A[i])
    else:
        b.insert(0, A[i])
if n % 2 == 1:
    b.reverse()
print(' '.join(map(str, b)))


Fixed submission:
class Cell:
    def __init__(self, entity, next, prev):
        self.entity = entity
        self.next = next
        self.prev = prev


n = int(input())
A = list(map(int, input().split()))
cell = Cell(A[0], None, None)
top = cell
last = cell

cnt = 0
for i in range(1, len(A)):
    cnt += 1
    if i % 2 == 0:
        tmp = last
        last = Cell(A[i], None, last)
        tmp.next = last
    else:
        tmp = top
        top = Cell(A[i], top, None)
        tmp.prev = top

b = []
cell = top
while(True):
    b.append(cell.entity)
    if not(cell.next):
        break
    cell = cell.next
if n % 2 == 1:
    b.reverse()
print(' '.join(map(str, b)))
Buggy python submission (verdict: Runtime Error):
import math

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

ans = 10 ** 9
for ai in a:
    ans = math.gcd(ans, ai)

print(ans)

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

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


ans = 0
for ai in a:
    ans = gcd(ans, ai)

print(ans)
Buggy python submission (verdict: Runtime Error):
# coding: utf-8

s = input()
k = int(input())

not_one_index = 0
i = 0
while True:
    if s[i] == '1':
        not_one_index = not_one_index + 1
        i = i + 1
    else:
        break

if k < not_one_index:
    print(1)
else:
    print(s[not_one_index])


Fixed submission:
# coding: utf-8

s = input()
k = int(input())

not_one_index = 0
for i in range(len(s)):
    if s[i] == '1':
        not_one_index = not_one_index + 1
    else:
        break

if k <= not_one_index:
    print(1)
else:
    print(s[not_one_index])

Buggy python submission (verdict: Runtime Error):
# coding: utf-8

s = input()
k = int(input())

not_one_index = 0
for i in range(k):
    if s[i] == '1':
        not_one_index = not_one_index + 1
    else:
        break

if k < not_one_index:
    print(1)
else:
    print(s[not_one_index])


Fixed submission:
# coding: utf-8

s = input()
k = int(input())

not_one_index = 0
for i in range(len(s)):
    if s[i] == '1':
        not_one_index = not_one_index + 1
    else:
        break

if k <= not_one_index:
    print(1)
else:
    print(s[not_one_index])