Harryxun/testdata huggingface dataset:
Buggy python submission (verdict: Runtime Error):
l=list(map(int,input().split()))
c=collections.Counter(l)
def j(n):
  judge=1
  for k  in c.keys():
      if n%k==0:
        if n!=k:
          judge=0
          break
  return judge
count=0
if len(list(c.keys()))==1:
       print(count)
else:
  for k in c.keys():
    if j(k)==1:
      count+=1
  print(count)
  

Fixed submission:
l=list(map(int,input().split()))
for i in range(5):
  if l[i]==0:
    print(i+1)
    break

Buggy python submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))
l.sort()
sum=1#個数
if l[0]==l[1]:
  sum=0
for j in range(1,n):
  i=1
  for m in range(0,j):
    if l[j]%l[m]==0:
      i=0
      break
  sum+=i
    
print(sum)

Fixed submission:
l=list(map(int,input().split()))
for i in range(5):
  if l[i]==0:
    print(i+1)
    break

Buggy python submission (verdict: Runtime Error):
a,b=map(int,input().split())
if 2*a<=b and b<=4*a and b%2==0:
  print('yes')
else:print('no')

Fixed submission:
l=list(map(int,input().split()))
for i in range(5):
  if l[i]==0:
    print(i+1)
    break
Buggy python submission (verdict: Runtime Error):
X,Y=map(int,input().split())
if 2＊X<=Y and Y<=4＊X and Y%2==0:
  print('yes')
else:print('no')

Fixed submission:
X,Y=map(int,input().split())
if 2*X <= Y and Y <= 4*X and Y%2 == 0:
  print('Yes')
else:print('No')
Buggy python submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))
l.sort()
sum=1#個数
if l[0]==l[1]:
  sum=0
for j in range(1,n):
  i=1
  for m in range(0,j):
    if l[j] % l[m]==0:
      i=0
      break
  sum+=i
    
print(sum)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
dp=[0]*(10**6+1)
for i in a:
  dp[i]+=1
for i in range(1,10**6+1):
  if dp[i]:
    for  j in range(2*i,10**6+1,i):
      dp[j]=0
print(dp.count(1))

Buggy python submission (verdict: Runtime Error):
n=int(input())
l=list(map(int,input().split()))
sum=1#個数
if l[0]==l[1]:
  sum=0
l.sort()
for j in range(1,n):
  i=1
  for m in range(0,j):
    if l[j]%l[m]==0:
      i=0
      break
  sum+=i
    
print(sum)

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
dp=[0]*(10**6+1)
for i in a:
  dp[i]+=1
for i in range(1,10**6+1):
  if dp[i]:
    for  j in range(2*i,10**6+1,i):
      dp[j]=0
print(dp.count(1))
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
def f():
  if 0 in a:
    print(0)
  else:
    b=1
    for i in range(0,n):
      b*=a[i]

      if b>10**8:
        print(-1)
        exit()
   
    print(b)

f()

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

print(M[0]*M[1])

Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
def main():
  if 0 in a:
    print(0)
  else:
  b=1
  for i in range(0,n):
    b*=a[i]

  if b<=10**8:
    print(b)
  else: print(-1)

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

print(M[0]*M[1])
Buggy python submission (verdict: Runtime Error):
n=int(input())
a=list(map(int,input().split()))
def f():
  if 0 in a:
    print(0)
  else:
    b=1
    for i in range(0,n):
      b*=a[i]

      if b>10**8:
        print(-1)
        return
   
  print(b)

f()

Fixed submission:
n=int(input())
a=list(map(int,input().split()))
b=1
if 0 in a:
  print(0)
else:
  for i in range(n):
    b*=a[i]
    if b>10**18:
      print(-1)
      exit()
  print(b)
Buggy python submission (verdict: Runtime Error):
import numpy as np
n=int(input())
count=[1]*(n+1)
x=[]#素因数格納
for i in range(2,n+1):
  if n%i==0 and count[i]==1:
    x.append(i)
    for j in range(2*i,n+1,i):
      count[j]=0
y=[]#指数
for i in x:
  c=1
  while n%(i**(c+1))==0:
    c+=1
  y.append(c)

def judge(y):
  i=1
  while np.arange(i+2).sum()<=y:
    i+=1
  return i
ans=0
for i in range(len(y)):
  ans+=judge(y[i])
print(ans)


Fixed submission:
import numpy as np
n=int(input())
if n==1:
  print(0)
else:
  def factorization(n):
      arr = []
      temp = n
      for i in range(2, int(-(-n**0.5//1))+1):
          if temp%i==0:
              cnt=0
              while temp%i==0:
                  cnt+=1
                  temp //= i
              arr.append([i, cnt])

      if temp!=1:
          arr.append([temp, 1])

      if arr==[]:
          arr.append([n, 1])

      return arr

  y=factorization(n)
  def judge(y):
    i=1
    while np.arange(i+2).sum()<=y:
      i+=1
    return i
  ans=0
  for i in range(len(y)):
    ans+=judge(y[i][1])
  print(ans)
Buggy python submission (verdict: Runtime Error):
k=int(input())
s=input()
import numpy as np
p=list(s)
l=len(p)
if l<=k:
  print(s)
else:
  arr=np.array(p)
  print(p+'...')

Fixed submission:
k=int(input())
s=input()
import numpy as np
p=list(s)
l=len(p)
if l<=k:
  print(s)
else:
  arr=np.array(p)
  arr=arr[0:k]
  print(''.join(list(arr))+'...')
Buggy python submission (verdict: Time Limit Exceeded):
import sys
from sys import stdin
def I():
    return stdin.readline().rstrip()
def MI():
    return map(int,stdin.readline().rstrip().split())
def LI():
    return list(map(int,stdin.readline().rstrip().split()))
#main part
from collections import deque
H,W=MI()
route=[list(I()) for _ in range(H)]
d=deque()
for h in range(H):
    for w in range(W):
        if route[h][w]=='#':
            d.append([h,w])
cnt=0
while d:
    l=list(d)
    d.clear()
    for Y,X in l:
        for y,x in [[Y-1,X],[Y+1,X],[Y,X-1],[Y,X+1]]:
            if 0<=y<H and 0<=x<W:
                if route[y][x]=='.':
                    route[y][x]='#'
                    d.append([y,x])
    cnt+=1
print(cnt-1)

Fixed submission:
import sys
from sys import stdin
def I():
    return stdin.readline().rstrip()
def MI():
    return map(int,stdin.readline().rstrip().split())
def LI():
    return list(map(int,stdin.readline().rstrip().split()))
#main part
from collections import deque
H,W=MI()
route=[list(I()) for _ in range(H)]
d=deque()
for h in range(H):
    for w in range(W):
        if route[h][w]=='#':
            d.append([h,w])
cnt=0
while d:
    l=list(d)
    d.clear()
    for Y,X in l:
        for y,x in [[Y-1,X],[Y+1,X],[Y,X-1],[Y,X+1]]:
            if 0<=y<H and 0<=x<W:
                if route[y][x]=='.':
                    route[y][x]='#'
                    d.append([y,x])
    cnt+=1
print(cnt-1)
Buggy python submission (verdict: Runtime Error):
N=int(input())
def f(N):
  i=0#桁数
  while N>1:
    N=N/10
    i+=1
  return i

x=f(N)
if N%x==0:
  print("Yes")
else: print("No")

Fixed submission:
import math
N=int(input())
def g(N):#桁数を返す
  i=0#桁数
  while N>=1:
    N=N/10
    i+=1
  return i

def f(N):
  j=g(N)
  S=0
  while j!=0:
    d=math.floor(N/(10**(j-1)))
    S+=d
    N-=d*(10**(j-1))
    j-=1
  return S
  
if N%f(N)==0:
  print("Yes")
else: print("No")

Buggy python submission (verdict: Runtime Error):
N=int(input())
def f(N):
  i=0#桁数
  while N>1:
    N=N/10
    i+=1
  return i

x=f(N)
if N%x==0:
  print("yes")
else: print("no")

Fixed submission:
import math
N=int(input())
def g(N):#桁数を返す
  i=0#桁数
  while N>=1:
    N=N/10
    i+=1
  return i

def f(N):
  j=g(N)
  S=0
  while j!=0:
    d=math.floor(N/(10**(j-1)))
    S+=d
    N-=d*(10**(j-1))
    j-=1
  return S
  
if N%f(N)==0:
  print("Yes")
else: print("No")
Buggy python submission (verdict: Time Limit Exceeded):
"""
N：都市の数
M:双方向道路の数
"""


class DisjointSet:
    def __init__(self, size):
        self.rank = [0] * size  # rank[x]：ノードxを木の親としたときの木の高さ
        self.p = [0] * size  # p[x]：ノードxの親

        for i in range(N):
            self.p[i] = i  # 自分自身を親
            self.rank[i] = 0  # 最初は自分だけなので木の高さは0

    def same(self, x, y):  # xとyが同じ集合に属しているのかどうかを確認
        return (self.findSet(x) == self.findSet(y))

    def unite(self, x, y):  # 結合
        self.link(self.findSet(x), self.findSet(y))

    def link(self, x_root, y_root):  # x_root(y_root):x(y)が属する集合の親
        if (self.rank[x_root] > self.rank[y_root]):
            self.p[y_root] = x_root
        else:
            self.p[x_root] = y_root
            if self.rank[x_root] == self.rank[y_root]:
                self.rank[y_root] += 1

    def findSet(self, x):  # xが属する集合の親を返す
        if x != self.p[x]:
            self.p[x] = self.findSet(self.p[x])

        return self.p[x]


N, M = map(int, input().split())
ds = DisjointSet(N)
parents = []

for _ in range(M):
    A, B = map(int, input().split())
    ds.unite(A-1, B-1)  # 都市Aと要素Bを結合

for i in range(N):
    parent = ds.findSet(i)

    if parent not in parents:
        parents.append(parent)

print(len(parents)-1)


Fixed submission:
class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


N, M = map(int, input().split())
uf = UnionFind(N)

for _ in range(M):
    A, B = map(int, input().split())
    uf.union(A - 1, B - 1)

roots = uf.roots()
print(len(roots)-1)
Buggy python submission (verdict: Runtime Error):
D, T, S = input1().split()
D=int(D)
T=int(T)
S=int(S)

if D // S > T:
    print('No')
else:
    print('Yes')

Fixed submission:
D, T, S = input().split()
d = float(D)
t = float(T)
s = float(S)

a = float(d / s)

if a > t:
    print("No")
else:
    print("Yes")
Buggy python submission (verdict: Time Limit Exceeded):
N = int(input())
A = list(map(int, input().split()))
num_sum = 0

for i in range(N - 1):
    a = A[i]
    temp_A = A[i + 1:N]
    temp_A = list(map(lambda x: x * a, temp_A))
    num_sum += sum(temp_A)


num_sum = num_sum % (10 ** 9 + 7)

print(num_sum)


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

num_sum = 0
temp_sum_num = sum(A)

for i in range(N - 1):
    temp_sum_num -= A[i]
    num_sum += A[i] * temp_sum_num


num_sum = num_sum % (10 ** 9 + 7)

print(num_sum)

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

for i in range(N - 1):
    for j in range(i + 1, N):
        sum += A[i] * A[j]


sum = sum % (10 ** 9 + 7)

print(sum)


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

num_sum = 0
temp_sum_num = sum(A)

for i in range(N - 1):
    temp_sum_num -= A[i]
    num_sum += A[i] * temp_sum_num


num_sum = num_sum % (10 ** 9 + 7)

print(num_sum)
Buggy python submission (verdict: Runtime Error):
import math
 
DISTANCE_NUM=0
 
N,D=(int(x) for x in input.split())
 
for _ in range(N)
  x,y=(int(x) for x in input.split())
  distance=math.sqrt(x**2+y**2)
  
  if distance <= D:
    DISTANCE_NUM+=1
    
print(DISTANCE_NUM)

Fixed submission:
import math
 
DISTANCE_NUM=0
 
N,D=map(int,input().split())
 
for _ in range(N):
  x,y=map(int,input().split())
  distance=math.sqrt(x**2+y**2)
  
  if distance <= D:
    DISTANCE_NUM+=1
    
print(DISTANCE_NUM)

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

DISTANCE_NUM=0

N,D=(int(x) for x in input.split())

for _ in range(N)
  x,y=(int(x) for in input.split())
  distance=math.sqrt(x**2+y**2)
  
  if distance <= D:
    DISTANCE_NUM+=1
    
print(DISTANCE_NUM)

Fixed submission:
import math
 
DISTANCE_NUM=0
 
N,D=map(int,input().split())
 
for _ in range(N):
  x,y=map(int,input().split())
  distance=math.sqrt(x**2+y**2)
  
  if distance <= D:
    DISTANCE_NUM+=1
    
print(DISTANCE_NUM)
Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
t = 10**9+7
z = list(map(int,input().split() ))
_sum = 0
y = len(z)
for i in range(y-1):
    _sum += (z[i]*sum(z[i+1:y]))
        #print("_sum:"+str(_sum))
print(_sum%t)
    

Fixed submission:
n = int(input())
t = 10**9+7
z = list(map(int,input().split() ))
_sum = 0
x = sum(z)
y = len(z)
for i in range(y-1):
    x = x-z[i]
    _sum += (z[i]*x)
        #print("_sum:"+str(_sum))
print(_sum%t)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
t = 10**9+7
z = list(map(int,input().split() ))
_sum = 0
y = len(z)
for i in range(y-1):
    _sum += (z[i]*sum(z[i+1:y]))
        #print("_sum:"+str(_sum))
print(_sum%t)
    

Fixed submission:
n = int(input())
t = 10**9+7
z = list(map(int,input().split() ))
_sum = 0
x = sum(z)
y = len(z)
for i in range(y-1):
    x = x-z[i]
    _sum += (z[i]*x)
        #print("_sum:"+str(_sum))
print(_sum%t)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
z = list(map(int,input().split()))
_sum = 0
y = len(z)
for i in range(y-1):
    a = z[i]
    b = sum(z[i+1:y])
    
    #print("b:"+str(b))
    _sum += (a*b)
        #print("_sum:"+str(_sum))
print(_sum % (10**9+7))
    

Fixed submission:
n = int(input())
t = 10**9+7
z = list(map(int,input().split() ))
_sum = 0
x = sum(z)
y = len(z)
for i in range(y-1):
    x = x-z[i]
    _sum += (z[i]*x)
        #print("_sum:"+str(_sum))
print(_sum%t)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
z = list(map(int,input().split()))
_sum = 0
y = len(z)
for i in range(y-1):
    a = z[i]
    b = sum(z[i+1:y])
    
    #print("b:"+str(b))
    _sum += (a*b)
        #print("_sum:"+str(_sum))
print(_sum % (10**9+7))

Fixed submission:
n = int(input())
t = 10**9+7
z = list(map(int,input().split() ))
_sum = 0
x = sum(z)
y = len(z)
for i in range(y-1):
    x = x-z[i]
    _sum += (z[i]*x)
        #print("_sum:"+str(_sum))
print(_sum%t)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
r = list(map(int,input().split()))
_sum = 0
o = 1
p= len(r)
z =[]
for g in range(p):
    v = r[g]%(10**9+7)
    z.append(v)
y = len(z)
for i in range(y-1):
    a = z[i]
    #print("a:" +str(a))
    for j in range(y-i-1):
        b=z[i+j+1]
    #print("b:"+str(b))
        _sum += (a*b)
        #print("_sum:"+str(_sum))
print(_sum % (10**9+7))
    

Fixed submission:
n = int(input())
t = 10**9+7
z = list(map(int,input().split() ))
_sum = 0
x = sum(z)
y = len(z)
for i in range(y-1):
    x = x-z[i]
    _sum += (z[i]*x)
        #print("_sum:"+str(_sum))
print(_sum%t)

Buggy python submission (verdict: Time Limit Exceeded):
n = int(input())
p = list(map(int,input().split()))
_sum = 0
y = len(p)
for i in range(y):
    a = p[i]
    #print("a:" +str(a))
    for j in range(y-i-1):
        b=p[i+j+1]
        #print("b:"+str(b))
        _sum += (a*b)
        #print("_sum:"+str(_sum))
print(_sum % (10**9+7))
    

Fixed submission:
n = int(input())
t = 10**9+7
z = list(map(int,input().split() ))
_sum = 0
x = sum(z)
y = len(z)
for i in range(y-1):
    x = x-z[i]
    _sum += (z[i]*x)
        #print("_sum:"+str(_sum))
print(_sum%t)
Buggy python submission (verdict: Runtime Error):
n=int(input())
s=int(input())
print(s.count("ABC"))

Fixed submission:
n=int(input())
s=input()
print(s.count("ABC"))
Buggy python submission (verdict: Runtime Error):
a,b = int(input().rstrip().split())

c = a * b

d = c / 2

if(d==0):
  print("Even")
else:
  print("Odd")

Fixed submission:
a,b=input().split()
c = int(a) * int(b)
d = int(c) % 2
if (d == 0):
    print("Even")
    
if (d == 1):
    print("Odd")
Buggy python submission (verdict: Time Limit Exceeded):
N,Y = map(int,input().split())
count = 0
for x in range(N+1):
    i = 10000 * x
    for y in range(N-x+1):
        j = 5000 * y
        for z in range(N-x-y+1):
            k = 1000 * z
            if(i+j+k == Y and x+y+z == N):
                count = 1
                f_x=x
                f_y=y
                f_z=z
                
if(count == 1):
    print(str(f_x)+" "+str(f_y)+" "+str(f_z))
if(count == 0):
    print("-1 -1 -1")

Fixed submission:
N,Y = map(int,input().split())
count = 0
for x in range(N+1):
    i = 10000 * x
    for y in range(N-x+1):
        j = 5000 * y
        if((Y-i-j)/1000+x+y == N and i+j+(N-x-y)*1000 == Y):
            count = 1
            z = N - x - y
            f_x=x
            f_y=y
            f_z=z
                
if(count == 1):
    print(str(f_x)+" "+str(f_y)+" "+str(f_z))
if(count == 0):
    print("-1 -1 -1")

Buggy python submission (verdict: Runtime Error):
count = 0
for x in range(N+1):
    i = 10000 * x
    for y in range(N-x+1):
        j = 5000 * y
        for z in range

            k = 1000 * z
            if(i+j+k == Y and x+y+z == N):
                count = 1
                f_x=x
                f_y=y
                f_z=z
                
if(count == 1):
    print(str(f_x)+" "+str(f_y)+" "+str(f_z))
if(count == 0):
    print("-1 -1 -1")

Fixed submission:
N,Y = map(int,input().split())
count = 0
for x in range(N+1):
    i = 10000 * x
    for y in range(N-x+1):
        j = 5000 * y
        if((Y-i-j)/1000+x+y == N and i+j+(N-x-y)*1000 == Y):
            count = 1
            z = N - x - y
            f_x=x
            f_y=y
            f_z=z
                
if(count == 1):
    print(str(f_x)+" "+str(f_y)+" "+str(f_z))
if(count == 0):
    print("-1 -1 -1")
Buggy python submission (verdict: Runtime Error):
n = input()

for i in range(2**3):
    ss =""
    for j in range(3):
        ss +=n[j]
        if((i >> j )&1==True):
            ss += "+"
        else:
            ss += "-"
    ans = eval(ss)
    if (ans == 7):
        ss += "=7"
        print(ss)

Fixed submission:
n = input()
for i in range(2**3):
    ss =""
    ss +=n[0]
    for j in range(3):
        if((i >> j )&1==True):
            ss += "+"
            ss += n[j+1]
        else:
            ss += "-"
            ss += n[j+1]
    ans = eval(ss)
    if (ans == 7):
        ss += "=7"
        print(ss)
        break
Buggy python submission (verdict: Time Limit Exceeded):
K,S = map(int,input().split())
count = 0
for i in range(0,K+1):
    for j in range(0,K+1):
        for k in range(0,K+1):
            ty = i + j + k
            if ( ty == S):
                count += 1
print(count)

Fixed submission:
K,S = map(int,input().split())
count = 0
for x in range(K+1):
    for y in range(K+1):
        z = S - x - y
        if (0 <= z < K + 1):
            count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
K,S = map(int,input().split())
count = 0
for i in range(0,K+1):
    X = i
    for j in range(0,K+1):
        Y = j
        for k in range(0,K+1):
            Z = k
            ty = X + Y + Z
            if ( ty == S):
                count += 1
print(count)

Fixed submission:
K,S = map(int,input().split())
count = 0
for x in range(K+1):
    for y in range(K+1):
        z = S - x - y
        if (0 <= z < K + 1):
            count += 1
print(count)

Buggy python submission (verdict: Time Limit Exceeded):
K,S = map(int,input().split())
count = 0
for i in range(0,K+1):
    X = i
    for j in range(0,K+1):
        Y = j
        for k in range(0,K+1):
            Z = k
            ty = X + Y + Z
            if ( ty == S):
                count += 1
print(count)

Fixed submission:
K,S = map(int,input().split())
count = 0
for x in range(K+1):
    for y in range(K+1):
        z = S - x - y
        if (0 <= z < K + 1):
            count += 1
print(count)

Buggy python submission (verdict: Runtime Error):
K,S = map(int,input().split())
count = 0
for i in range(0,K+1):
    X = i
    for j in range(0,K+1):
        Y = j
        for k in range(0,K+1):
            Z = k
            if ( ty == S):
                count += 1
print(count)

Fixed submission:
K,S = map(int,input().split())
count = 0
for x in range(K+1):
    for y in range(K+1):
        z = S - x - y
        if (0 <= z < K + 1):
            count += 1
print(count)
Buggy python submission (verdict: Runtime Error):
5 5 7
Yes
N,L = map(int,input().split())
str_list=[]
final_str = ""
for i in range(N):
    str_list.append(input())
new_list = sorted(str_list)
for n in range(N):
    final_str += new_list[n]
print(final_str)
3 3

Fixed submission:
N,L = map(int,input().split())
str_list=[]
final_str = ""
for i in range(N):
    str_list.append(input())
new_list = sorted(str_list)
for n in range(N):
    final_str += new_list[n]
print(final_str)
Buggy python submission (verdict: Runtime Error):
def run(x):
    '''

    '''
    print('{}'.format(0 if x==1 else 1))



if __name__ == '__main__':
    x = int(input())
    run(x)def run(x):
    '''

    '''
    print('{}'.format(0 if x==1 else 1))



if __name__ == '__main__':
    x = int(input())
    run(x)

Fixed submission:
def run(x):
    '''

    '''
    print('{}'.format(0 if x==1 else 1))



if __name__ == '__main__':
    x = int(input())
    run(x)
Buggy python submission (verdict: Runtime Error):
def run(x):
    '''

    '''


    sum = 0
    while x > 0:
        sum += x%10
        x = int(x/10)

    print('Yes' if sum % 9 == 0 else 'No')


if __name__ == '__main__':
    x = int(input())
    run(x)

Fixed submission:
def run(x):
    '''

    '''


    # sum = 0
    # while x > 0:
    #     sum += x%10
    #     x = int(x/10)

    # print('Yes' if sum % 9 == 0 else 'No')
    print('Yes' if x % 9 == 0 else 'No')


if __name__ == '__main__':
    x = int(input())
    run(x)
Buggy python submission (verdict: Runtime Error):
def run(n):
    '''
    '''
    _base_array = string.ascii_lowercase
    results = []
    while n > 0:
        results.append(_base_array[n%26 - 1])
        if n%26 == 0:
            n = n//26 - 1
            continue
        n = n//26

    print(''.join(results[::-1]))



if __name__ == '__main__':
    n = int(input())
    run(n)

Fixed submission:
import string

def run(n):
    '''
    '''
    _base_array = string.ascii_lowercase
    results = []
    while n > 0:
        results.append(_base_array[n%26 - 1])
        if n%26 == 0:
            n = n//26 - 1
            continue
        n = n//26

    print(''.join(results[::-1]))



if __name__ == '__main__':
    n = int(input())
    run(n)