Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Time Limit Exceeded):
import numpy as np

N = int(input())

X = np.array(list(map(int,input().split())))

for i in range(N):
    temp = np.r_[X[:i],X[i+1:]]
    print(int(np.median(temp)))

Fixed submission:
N = int(input())

X = list(map(int,input().split()))
sortX = sorted(X)

A = sortX[(N//2)-1]
B = sortX[(N//2)]

for x in X:
    if x<B: print(B)
    else: print(A)
Buggy python submission (verdict: Time Limit Exceeded):
H,W,D = map(int,input().split())

M = {}

for h in range(H):
    A = list(map(int,input().split()))
    for w in range(len(A)):
        M[A[w]] = [h,w]
        
Q = int(input())

anslist = []
for q in range(Q):
    ans = 0
    L,R = map(int,input().split())
    now = M[L]
    for i in range(L+D,R+1,D):
        nex = M[i]
        ans += abs(nex[0]-now[0])+abs(nex[1]-now[1])
        now = nex
    anslist.append(str(ans))
        
print("\n".join(anslist))

Fixed submission:
H,W,D = map(int,input().split())

M = {}

for h in range(H):
    A = list(map(int,input().split()))
    for w in range(len(A)):
        M[A[w]] = [h,w]

anslist = []
for d in range(1,D+1):
    ans = 0
    sub_anslist = [ans]
    now = M[d]
    for i in range(d+D,(H*W)+1,D):
        nex = M[i]
        ans += abs(nex[0]-now[0])+abs(nex[1]-now[1])
        sub_anslist.append(ans)
        now = nex
    anslist.append(sub_anslist)

Q = int(input())
output = []
for q in range(Q):
    L,R = map(int,input().split())
    left = anslist[(L-1)%D][(L-1)//D]
    right = anslist[(R-1)%D][(R-1)//D]
    output.append(str(right-left))
        
print("\n".join(output))
Buggy python submission (verdict: Runtime Error):
N,M = map(int,input().split())

T = (1900*M)+(100*(N-M))
C = [pow(2,M),pow(2,M)-1]

if M==4: M_set[1]=3

a = T*C[0]
if a%C[1]==0:
    a = a//C[1]
    print(a)
else:
    print(a)

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

T = (1900*M)+(100*(N-M))
C = [pow(2,M),pow(2,M)-1]

print(T*C[0])

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

T = (1900*M)+(100*(N-M))
C = [pow(2,M),pow(2,M)-1]

if M==4: M_set[1]=3

a = T*C[0]
if a%C[1]==0:
    print(a//C[1])
else:
    print(a)

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

T = (1900*M)+(100*(N-M))
C = [pow(2,M),pow(2,M)-1]

print(T*C[0])

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

T = (1900*M)+(100*(N-M))
C = [pow(2,M),pow(2,M)-1]

if M==4: M_set[1]=3

a = T*C[0]
if a//C[1] %C[1]==0:
    print(a//C[1])
else:
    print(a)

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

T = (1900*M)+(100*(N-M))
C = [pow(2,M),pow(2,M)-1]

print(T*C[0])

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

T = (1900*M)+(100*(N-M))
C = [pow(2,M),pow(2,M)-1]

if M==4: M_set[1]=3

ans = T*C[0]//C[1] if ans%C[1]==0 else T*C[0]
    
print(ans)

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

T = (1900*M)+(100*(N-M))
C = [pow(2,M),pow(2,M)-1]

print(T*C[0])

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

T = (1900*M)+(100*(N-M))
C = [pow(2,M),pow(2,M)-1]

if M==4: M_set[1]=3

print(T*C[0]//C[1] if ans%C[1]==0 else T*C[0])

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

T = (1900*M)+(100*(N-M))
C = [pow(2,M),pow(2,M)-1]

print(T*C[0])
Buggy python submission (verdict: Runtime Error):
N = int(math.sqrt(int(input())))

print(N*N)

Fixed submission:
import math
N = int(math.sqrt(int(input())))
print(N*N)
Buggy python submission (verdict: Time Limit Exceeded):
import bisect

N = int(input())
A = sorted(list(map(int,input().split())))
B = list(map(int,input().split()))
C = sorted(list(map(int,input().split())))

ans = 0
#print(A)
#print(C)
for b in B:
    lenA = bisect.bisect_left(A,b) #競合時は無事無視される
    lenC = N - bisect.bisect_left(C,b) if b not in C else N - C.index(b) - 1
    ans += lenA*lenC
    #print(lenA,lenC)
    
print(ans)

Fixed submission:
import bisect

N = int(input())
A = sorted(list(map(int,input().split())))
B = list(map(int,input().split()))
C = sorted(list(map(int,input().split())))

ans = 0
#print(A)
#print(C)
for b in B:
    lenA = bisect.bisect_left(A,b)
    lenC = N - bisect.bisect(C,b)
    ans += lenA*lenC
    #print(lenA,lenC)
    
print(ans)

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

ans = 0
#print(A)
#print(C)
for b in B:
    lenA = bisect.bisect_left(A,b) #競合時は無事無視される
    lenC = N - bisect.bisect_left(C,b) if b not in C else N - C.index(b) - 1
    ans += lenA*lenC
    #print(lenA,lenC)
    
print(ans)

Fixed submission:
import bisect

N = int(input())
A = sorted(list(map(int,input().split())))
B = list(map(int,input().split()))
C = sorted(list(map(int,input().split())))

ans = 0
#print(A)
#print(C)
for b in B:
    lenA = bisect.bisect_left(A,b)
    lenC = N - bisect.bisect(C,b)
    ans += lenA*lenC
    #print(lenA,lenC)
    
print(ans)

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

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

ans = 0
for b in B:
    a = len(list(filter(lambda x:x<b,A)))
    c = len(list(filter(lambda x:x>b,C)))
    ans += 1*a*c
    
print(ans)

Fixed submission:
import bisect

N = int(input())
A = sorted(list(map(int,input().split())))
B = list(map(int,input().split()))
C = sorted(list(map(int,input().split())))

ans = 0
#print(A)
#print(C)
for b in B:
    lenA = bisect.bisect_left(A,b)
    lenC = N - bisect.bisect(C,b)
    ans += lenA*lenC
    #print(lenA,lenC)
    
print(ans)
Buggy python submission (verdict: Runtime Error):
%%time
N = int(input())

isok=False
for h in range(1,3501):
    bunsi = 4*h - N
    bunbo = N*h
    if bunsi>0:
        n = (bunbo//bunsi) + 1
        bunsi = 4*h*n - N*(h+n)
        bunbo = N*h*n
        if bunsi>0 and bunbo%bunsi==0:
            w = bunbo//bunsi
            isok = True
            break
        
if isok:
    print(h,n,w)
else:
    print("ここ来たらマジでヤバいが")

Fixed submission:
#%%time
N = int(input())

isok=False
for h in range(1,3501):
    bunsi = 4*h - N
    bunbo = N*h
    if bunsi>0:
        n = (bunbo//bunsi) + 1
        bunsi = 4*h*n - N*(h+n)
        bunbo = N*h*n
        if bunsi>0 and bunbo%bunsi==0:
            w = bunbo//bunsi
            isok = True
            break
        
if isok:
    print(h,n,w)
else:
    print("ここ来たらマジでヤバいが")

Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

isok=False
for h in range(1,3501):
    for n in range(1,3501):
        bunsi = 4*h*n - N*(h+n)
        bunbo = N*h*n
        if bunsi>0 and bunbo%bunsi==0:
            w = bunbo//bunsi
            isok = True
            break
    if isok:break
        
if isok:
    print(h,n,w)
else:
    print("ここ来たらマジでヤバいが")

Fixed submission:
#%%time
N = int(input())

isok=False
for h in range(1,3501):
    bunsi = 4*h - N
    bunbo = N*h
    if bunsi>0:
        n = (bunbo//bunsi) + 1
        bunsi = 4*h*n - N*(h+n)
        bunbo = N*h*n
        if bunsi>0 and bunbo%bunsi==0:
            w = bunbo//bunsi
            isok = True
            break
        
if isok:
    print(h,n,w)
else:
    print("ここ来たらマジでヤバいが")
Buggy python submission (verdict: Runtime Error):
A,B,C,D,E,F = map(int,input().split())

water_sugar = []
sugar_best = []
max_sugar = 0

for a in range(0,31):
    water = A*a
    sugar = E*water
    if water==0:
        pass
    elif (water*100)>F:
        break
    elif (water*100)+sugar>F:
        s = F-(water*100)
        water_sugar.append([water*100,s])
    elif (water*100)+sugar<=F:
        s = sugar
        water_sugar.append([water*100,s])
    if s>max_sugar: max_sugar=s
    for b in range(1,31):
        water += B
        sugar = E*water
        if (water*100)>F:
            break
        elif (water*100)+sugar>F:
            s = F-(water*100)
            water_sugar.append([water*100,s])
        elif (water*100)+sugar<=F:
            s = sugar
            water_sugar.append([water*100,s])
        if s>max_sugar: max_sugar=s
        

#print(water_sugar)
#print(max_sugar)

sugar = []
c=0
while(True):
    s = c*C
    if s<=max_sugar:
        sugar.append(s)
    else:
        break
    while(True):
        s += D
        if s<=max_sugar:
            sugar.append(s)
        else:
            break
    c+=1
sugar = sorted(sugar,reverse=True)

#print(sugar)

for ws in water_sugar:
    for s in sugar:
        if s<=ws[1]: break
    ws[1] = s
    sugar_best.append((100*ws[1])/(ws[0]+ws[1]))
    
best = water_sugar[sugar_best.index(max(sugar_best))]

print(best[0]+best[1],best[1])

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

water_sugar = []
sugar_best = []

for a in range(0,31):
    water = A*a
    sugar = E*water
    if water==0:
        pass
    elif (water*100)>F:
        break
    elif (water*100)+sugar>F:
        water_sugar.append([water*100,F-(water*100)])
    elif (water*100)+sugar<=F:
        water_sugar.append([water*100,sugar])
    for b in range(1,31):
        water += B
        sugar = E*water
        if (water*100)>F:
            break
        elif (water*100)+sugar>F:
            water_sugar.append([water*100,F-(water*100)])
        elif (water*100)+sugar<=F:
            water_sugar.append([water*100,sugar])

#print(water_sugar)

for ws in water_sugar:
    sugar = []
    c=0
    while(True):
        s = c*C
        if s<=ws[1]:
            sugar.append(s)
        else:
            break
        while(True):
            s += D
            if s<=ws[1]:
                sugar.append(s)
            else:
                break
        c+=1
    ws[1] = max(sugar)
    sugar_best.append((100*ws[1])/(ws[0]+ws[1]))
    
best = water_sugar[sugar_best.index(max(sugar_best))]

print(best[0]+best[1],best[1])
Buggy python submission (verdict: Runtime Error):
#AGC018 A
import math

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

A = list(map(int,input().split()))
MAX = max(A)

if K in A:
    print("POSSIBLE")
elif K<=MAX:
    GCD = A[0]
    for a in A[1:]: GCD = math.gcd(GCD,a)
    if K%GCD==0:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")
else:
    print("IMPOSSIBLE")

Fixed submission:
#AGC018 A
import fractions

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

A = list(map(int,input().split()))
MAX = max(A)

if K in A:
    print("POSSIBLE")
elif K<=MAX:
    GCD = A[0]
    for a in A[1:]: GCD = fractions.gcd(GCD,a)
    if K%GCD==0:
        print("POSSIBLE")
    else:
        print("IMPOSSIBLE")
else:
    print("IMPOSSIBLE")
Buggy python submission (verdict: Runtime Error):
N = int(input())

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


B = [A[0],(-1)*(A[0])//abs(A[0])]
ANS = []
#print(b)
for i in range(len(B)):
    b = B[i]
    ans = 0
    if i==1: ans = abs(b)+1
    for a in A[1:]:
        #print("a+b"+str(a+b))
        if a+b==0:
            ans += 1
            b = (-1)*(b)//abs(b)
        elif b*(a+b)<0:
            b += a
        else:
            ans += abs(a+b)+1
            #print("ans"+str(ans))
            b = (-1)*(a+b)//abs(a+b)
        #print(b)
    ANS.append(ans)
print(min(ANS))

Fixed submission:
N = int(input())

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

if A[0]==0:
    B = [1,-1]
    ANS = [1,1]
else:
    B = [A[0],(-1)*(A[0])//abs(A[0])]
    ANS = [0,abs(A[0])+1]

#print(b)
for i in range(len(B)):
    b = B[i]
    for a in A[1:]:
        #print("a+b"+str(a+b))
        if a+b==0:
            ANS[i] += 1
            b = (-1)*(b)//abs(b)
        elif b*(a+b)<0:
            b += a
        else:
            ANS[i] += abs(a+b)+1
            #print("ans"+str(ans))
            b = (-1)*(a+b)//abs(a+b)
        #print(b)
print(min(ANS))
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())

A = sorted(list(map(int,input().split())))
B = [sum(A[:i+1]) for i in range(N)][::-1]
A.reverse()

min_abs = A[0]
ans = 1
for i in range(1,N):
    if A[i]*2 >= min_abs:
        ans += 1
    elif B[i]*2 >= min_abs:
        ans += 1
    else:
        break
    min_abs = A[i]
    
print(ans)

Fixed submission:
N = int(input())

A = sorted(list(map(int,input().split())),reverse=True)

min_abs = A[0]
ans = 1
for i in range(1,N):
    if A[i]*2 >= min_abs:
        ans += 1
    elif sum(A[i:])*2 >= min_abs:
        ans += 1
    else:
        break
    min_abs = A[i]
    
print(ans)
Buggy python submission (verdict: Time Limit Exceeded):
X = input()

while(True):
    temp = X.replace("ST","")
    if len(X)==len(temp):break
    X = temp
    
print(len(X))

Fixed submission:
X = input()

T = 0
S = 0
TS = True
for x in X:
    if x=="T":
        if TS:
            T += 1
        else:
            S -= 1
            if S==0:
                TS = True
    else:
        if TS: TS = False
        S += 1
    
print(T+S)
Buggy python submission (verdict: Runtime Error):
from scipy.special import comb
n = int(input())
List = list(map(int, input().split()))
List.sort()
idx = n // 2
ans = List[idx]-List[idx-1]
print(ans)

Fixed submission:
n = int(input())
List = list(map(int, input().split()))
List.sort()
idx = n // 2
ans = List[idx]-List[idx-1]
print(ans)
Buggy python submission (verdict: Runtime Error):
a, b, c, d = map(int, input().split())
all_count = b - a + 1

def f(x, y, z):
    cnt = y // z - x // z
    if x % z == 0:
        cnt += 1
    return cnt

div_c_count = f(a, b, c)
div_d_count = f(a, b, d)

import math
lcm = c * d // math.gcd(c, d)
cm_count = f(a, b, lcm)

print(all_count - (div_c_count + div_d_count - cm_count))

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

def f(x, y, z):
    cnt = y // z - x // z
    if x % z == 0:
        cnt += 1
    return cnt

div_c_count = f(a, b, c)
div_d_count = f(a, b, d)

import fractions
lcm = c * d // fractions.gcd(c, d)
cm_count = f(a, b, lcm)

print(all_count - (div_c_count + div_d_count - cm_count))
Buggy python submission (verdict: Runtime Error):
n, m = map(int, input().split())
MOD = 1000000007

traps = {}
for i in range(m):
    t = int(input())
    traps[t] = 1

mem = {}

def f(k):
    if k in mem:
        return mem[k]

    if k >= n:
        return 0
    if k == n - 1:
        return 1
    if k == n - 2:
        if n - 1 in traps:
            return 1
        else:
            return 2

    res = 0
    if k + 1 not in traps:
        res += f(k + 1)
    if k + 2 not in traps:
        res += f(k + 2)
    mem[k] = res
    return res % MOD

print(f(0))

Fixed submission:
import sys
sys.setrecursionlimit(10 ** 8)

n, m = map(int, input().split())
MOD = 1000000007

traps = {}
for i in range(m):
    t = int(input())
    traps[t] = 1

mem = {}

def f(k):
    if k in mem:
        return mem[k]

    if k >= n:
        return 0
    if k == n - 1:
        return 1
    if k == n - 2:
        if n - 1 in traps:
            return 1
        else:
            return 2

    res = 0
    if k + 1 not in traps:
        res += f(k + 1)
    if k + 2 not in traps:
        res += f(k + 2)
    mem[k] = res

    return res % MOD

print(f(0))
Buggy python submission (verdict: Time Limit Exceeded):
h, w = map(int, input().split())

m = []
for i in range(h):
    row = [0 if a == "#" else 1 for a in list(input())]
    m.append(row)

res = 0
for i in range(h):
    for j in range(w):
        a = m[i][j]
        if a == 0:
            continue
        cnt = 1

        k = i -1
        while k >= 0:
            if m[k][j] == 0:
                break
            k -= 1
            cnt += 1

        k = i + 1
        while k < h:
            if m[k][j] == 0:
                break
            k += 1
            cnt += 1

        l = j - 1
        while l >= 0:
            if m[i][l] == 0:
                break
            l -= 1
            cnt += 1

        l = j + 1
        while l < w:
            if m[i][l] == 0:
                break
            l += 1
            cnt += 1

        res = max(res, cnt)

print(res)

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

m = []
for i in range(h):
    row = list(input())
    m.append(row)

res = 0

mem = [[] for i in range(h)]
dummy = (-1, -1)

for i in range(h):
    _mem = mem[i]
    for j in range(w):
        a = m[i][j]

        if a == "#":
            _mem.append(dummy)
            continue

        c_cnt = 0
        r_cnt = 0

        above = mem[i - 1][j] if i > 0 else dummy
        if above == dummy:
            for ii in range(i + 1, h):
                if m[ii][j] == "#":
                    break
                c_cnt += 1
        else:
            c_cnt = above[0]

        left = mem[i][j - 1] if j > 0 else dummy
        if left == dummy:
            for jj in range(j + 1, w):
                if m[i][jj] == "#":
                    break
                r_cnt += 1
        else:
            r_cnt = left[1]

        res = max(res, c_cnt + r_cnt + 1)
        _mem.append((c_cnt, r_cnt))

print(res)
Buggy python submission (verdict: Time Limit Exceeded):
n, k = map(int, input().split())
vs = list(map(int, input().split()))

from collections import deque
from heapq import heappush, heappop
from itertools import product

res = 0

for comb in product([1, 2, 3, 4], repeat=k):
    dq = deque(vs)
    hq = []
    valid = True
    for i in range(k):
        s = comb[i]
        if s == 1:
            if len(dq) > 0:
                heappush(hq, dq.popleft())
            else:
                valid = False
                break
        elif s == 2:
            if len(dq) > 0:
                heappush(hq, dq.pop())
            else:
                valid = False
                break
        elif s == 3:
            if len(hq) > 0:
                dq.appendleft(heappop(hq))
            else:
                valid = False
                break
        else:
            if len(hq) > 0:
                dq.append(heappop(hq))
            else:
                valid = False
                break
    if valid:
        res = max(res, sum(hq))

print(res)

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

from collections import deque
from heapq import heappush, heappop

res = 0

for i in range(0, min(k, n) + 1):
    for j in range(i + 1):
        a = j
        b = i - j

        hq = []
        dq = deque(vs)

        for _ in range(a):
            heappush(hq, dq.popleft())
        for _ in range(b):
            heappush(hq, dq.pop())

        c = k - a - b
        for _ in range(c):
            if len(hq) == 0:
                break
            v = heappop(hq)
            if v > 0:
                heappush(hq, v)
                break

        res = max(res, sum(hq))

print(res)
Buggy python submission (verdict: Runtime Error):
import math

n, k = map(int, input().split())
res = 0

for i in range(1, n + 1):
    c = math.ceil(math.log2(k / i))
    res += (1 / n) * (0.5 ** c)

print(res)

Fixed submission:
import math

n, k = map(int, input().split())
res = 0

for i in range(1, n + 1):
    if i > k:
        res += 1 / n
    else:
        c = math.ceil(math.log(k / i, 2))
        res += (1 / n) * (0.5 ** c)

print(res)
Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
print([[0,b//2][a>5,b][a>12])

Fixed submission:
a,b=map(int,input().split())
print([[0,b//2][a>5],b][a>12])
Buggy python submission (verdict: Runtime Error):
S=input()
print(["Heisei,""TBD"][int(S[5:7]+S[8:10])>430])

Fixed submission:
S=input()
print(["Heisei","TBD"][int(S[5:7]+S[8:10])>430])
Buggy python submission (verdict: Runtime Error):
K=int(input())
print(K//2*(K//2+k%2))

Fixed submission:
K=int(input())
print(K//2*(K//2+K%2))
Buggy python submission (verdict: Runtime Error):
X=map(int,input().split())
print(max(X)-min(X))

Fixed submission:
X=list(map(int,input().split()))
print(max(X)-min(X))
Buggy python submission (verdict: Time Limit Exceeded):
n=int(input())
m=max(n,2)+1
while 1:
    if m%2 and m%n:
        print(m)
    m+=1

Fixed submission:
n=int(input())
print(n*(1+n%2))
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
print(["No","Yes"][abs(a-c)<=d or (abs(a-b)<=d and abs(b-c)<=d])

Fixed submission:
a,b,c,d=map(int,input().split())
print(["No","Yes"][abs(a-c)<=d or (abs(a-b)<=d and abs(b-c)<=d)])
Buggy python submission (verdict: Runtime Error):
a,b,x=map(int,input().split())
print(["NO","YES"]][a<=x<a+b])

Fixed submission:
a,b,x=map(int,input().split())
print(["NO","YES"][a<=x<a+b])

Buggy python submission (verdict: Runtime Error):
a,b,x=map(int,input().split())
print(["NO","YES"]][a>x])

Fixed submission:
a,b,x=map(int,input().split())
print(["NO","YES"][a<=x<a+b])
Buggy python submission (verdict: Runtime Error):
x=[input() for _ in range(3)]
for i in range(3):
    print(x[i][i],seq="")

Fixed submission:
x=[input() for _ in range(3)]
for i in range(3):
    print(x[i][i],end="")
Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
print([["Balanced,"Left"][a+b>c+d],"Right"][a+b<c+d])

Fixed submission:
a,b,c,d=map(int,input().split())
print([["Balanced","Left"][a+b>c+d],"Right"][a+b<c+d])

Buggy python submission (verdict: Runtime Error):
a,b,c,d=map(int,input().split())
[["Balanced,"Left"][a+b>c+d],"Right"][a+b<c+d]

Fixed submission:
a,b,c,d=map(int,input().split())
print([["Balanced","Left"][a+b>c+d],"Right"][a+b<c+d])
Buggy python submission (verdict: Runtime Error):
a,b=map(int(input()).split())
print(["Possible","Impossible"][a%3==b%3 and (a%3==1 or a%3==2)]

Fixed submission:
a,b=map(int,input().split())
print(["Possible","Impossible"][a%3==b%3 and (a%3==1 or a%3==2)])

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
print(["Possible","Impossible"][a%3==b%3 and (a%3==1 or a%3==2)]

Fixed submission:
a,b=map(int,input().split())
print(["Possible","Impossible"][a%3==b%3 and (a%3==1 or a%3==2)])

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
print(["Possible","Impossible"][a%3==b%3 and a%3==1 or a%3==2]

Fixed submission:
a,b=map(int,input().split())
print(["Possible","Impossible"][a%3==b%3 and (a%3==1 or a%3==2)])
Buggy python submission (verdict: Runtime Error):
x,y=map(int,input().split())
G=121313113131
print(["No","Yes"][G[x-1]==G[y-1]])

Fixed submission:
x,y=map(int,input().split())
s1={1,3,5,7,8,10,12}
s2={4,6,9,11}
print(["No","Yes"][(x in s1 and y in s1) or (x in s2 and y in s2)])
Buggy python submission (verdict: Runtime Error):
a=(int(input())-2)%13
b=(int(input())-2)%13
print(["Draw","Bob","Alice"][((a==b)+1)*((a<b)-(b<a))])

Fixed submission:
a,b=map(int,input().split())
if a==1:a=14
if b==1:b=14
if a>b:
    print("Alice")
elif a==b:
    print("Draw")
else:
    print("Bob")

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if a>b:
    print("Alice")
elif a=b:
    print("Draw")
else:
    print("Bob")

Fixed submission:
a,b=map(int,input().split())
if a==1:a=14
if b==1:b=14
if a>b:
    print("Alice")
elif a==b:
    print("Draw")
else:
    print("Bob")
Buggy python submission (verdict: Runtime Error):
s=input()
print(["vowel","consonant"][s="a" or s="i" or s="u" or s="e" or s="o"])


Fixed submission:
s=input()
print(["consonant","vowel"][s=="a" or s=="i" or s=="u" or s=="e" or s=="o"])
Buggy python submission (verdict: Runtime Error):
print(len(set([input() for i in range(3)])))

Fixed submission:
print(len(set(input().split())))
Buggy python submission (verdict: Runtime Error):
import fraction
from functools import reduce


def gcd(numbers):
    return reduce(fraction.gcd, numbers)

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

print(gcd(a))

Fixed submission:
import fractions
from functools import reduce


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

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

print(gcd(a))